gcp_compute_instance randomly chooses boot device from multiple devices

6 views
Skip to first unread message

Libo Yu

unread,
Oct 23, 2023, 9:46:59 AM10/23/23
to Ansible Project
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?

Will McDonald

unread,
Oct 23, 2023, 10:18:54 AM10/23/23
to ansible...@googlegroups.com
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 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.



On Mon, 23 Oct 2023 at 14:46, Libo Yu <libo...@gmail.com> wrote:
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?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/85f425fd-cc2d-4717-ac29-c864debdf31an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages