# gcp\_compute\_instance randomly chooses boot device from multiple devices

**URL:** <https://forum.ansible.com/t/gcp-compute-instance-randomly-chooses-boot-device-from-multiple-devices/38539>\
**Category:** Ansible Project\
**Tags:** gcp\
**Created:** [October 21, 2023, 2:35am UTC](https://forum.ansible.com/t/gcp-compute-instance-randomly-chooses-boot-device-from-multiple-devices/38539 "2023-10-21T02:35:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Libo\_Yu](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@Libo\_Yu](https://forum.ansible.com/u/Libo_Yu)\
**Post date:** [October 21, 2023, 2:35am UTC](https://forum.ansible.com/t/gcp-compute-instance-randomly-chooses-boot-device-from-multiple-devices/38539/1 "2023-10-21T02:35:02Z")

</div>

We are using ansible 2.9 on red hat 9. We try to create a GCP instance with more than one persistent disks. We pass a list of disks to “disks” property. The first one is the boot drive and its bool flag is set to true. But we observe that in many cases, the second one drive or other drive is used as boot drive. When the same ansible script is used on red hat 7, it never has this issue. Anybody has any idea about this issue?

---

<div class="post-metadata">

**Author:** ![Will\_McDonald](https://avatars.discourse-cdn.com/v4/letter/w/f475e1/32.png) [@Will\_McDonald](https://forum.ansible.com/u/Will_McDonald)\
**Post date:** [October 23, 2023, 2:18pm UTC](https://forum.ansible.com/t/gcp-compute-instance-randomly-chooses-boot-device-from-multiple-devices/38539/2 "2023-10-23T14:18:27Z")

</div>

Without seeing any sample code it’s impossible to be sure.

However, this is _probably_ something to do with persistent disk enumeration/Udev behaviour.

For GCP see: [https://cloud.google.com/compute/docs/disks/set-persistent-device-name-in-linux-vm](https://cloud.google.com/compute/docs/disks/set-persistent-device-name-in-linux-vm) But this isn’t specific to Google Cloud, other public clouds and virtualisation platforms demonstrate the same behavior.

If ‘pass a list of disks to “disks” property’ includes paths like /dev/sda, /dev/sdb, for example, then it’s entirely possible that /dev/sda and /dev/sdb would switch round after a VM restart. Udev endeavours to provide rules to prevent this but it isn’t 100% reliable.
