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?
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.