Hello,
I am creating VM, and disks on VM, and I am occurring a problem, where
the logical names of the disks are probably not created / assigned
sequentially.
This is the outcome that I would expect:
disk_name | logical_name
--------------------------------
os_disk | /dev/sda
vm.example.com_4 | /dev/sdb
vm.example.com_3 | /dev/sdc
vm.example.com_2 | /dev/sdd
vm.example.com_1 | /dev/sde
However I have experienced on multiple occasions that the logical names
are mixed, for example like this (see row 1 and 2):
disk_name | logical_name
--------------------------------
os_disk | /dev/sdb
vm.example.com_4 | /dev/sda
vm.example.com_3 | /dev/sdc
vm.example.com_2 | /dev/sdd
vm.example.com_1 | /dev/sde
I have tried to add state: "present" and wait: true parameters for each
disk, but this has not helped, and I am still facing the same problem.
ansible snippet below
any tips/advices where to dig?
Steps to reproduce:
---
- name: Auth ovirt
ovirt.ovirt.ovirt_auth:
url:
https://ovirt.example.com/ovirt-engine/api
# ...
- name: Create vm
vm.example.com
ovirt.ovirt.ovirt_vm:
high_availability: true
auth: "{{ ovirt_auth }}"
state: stopped
cpu_cores: "2"
memory: "6GiB"
memory_max: "6GiB"
name: "vm.example.com"
template: "linux"
cluster: "prod"
type: server
graphical_console:
headless_mode: true
operating_system: "linux"
nics:
- name: eth0
profile_name: "vlan"
cloud_init_persist: true
cloud_init:
dns_servers: "1.1.1.1 1.0.0.1"
host_name: "vm.example.com"
user_name: root
root_password: "ROOT_PASSWORD"
authorized_ssh_keys: "SSH_KEY"
cloud_init_nics:
- nic_name: enp1s0
nic_boot_protocol: static
nic_ip_address: "10.0.0.1"
nic_netmask: "255.255.255.0"
nic_gateway: "10.0.0.254"
- ovirt.ovirt.ovirt_disk:
name: os_disk
bootable: true
vm_name: "vm.example.com"
auth: "{{ ovirt_auth }}"
state: "present"
wait: true
- ovirt.ovirt.ovirt_disk:
name: "vm.example.com_4"
auth: "{{ ovirt_auth }}"
vm_name: "vm.example.com"
size: "2GiB"
format: cow
interface: virtio_scsi
storage_domain: "STORAGE_DOMAIN"
state: "present"
wait: true
- ovirt.ovirt.ovirt_disk:
name: "vm.example.com_3"
auth: "{{ ovirt_auth }}"
vm_name: "vm.example.com"
size: "5GiB"
format: cow
interface: virtio_scsi
storage_domain: "STORAGE_DOMAIN"
state: "present"
wait: true
- ovirt.ovirt.ovirt_disk:
name: "vm.example.com_2"
auth: "{{ ovirt_auth }}"
vm_name: "vm.example.com"
size: "20GiB"
format: cow
interface: virtio_scsi
storage_domain: "STORAGE_DOMAIN"
state: "present"
wait: true
- ovirt.ovirt.ovirt_disk:
name: "vm.example.com_1"
auth: "{{ ovirt_auth }}"
vm_name: "vm.example.com"
size: "5GiB"
format: cow
interface: virtio_scsi
storage_domain: "STORAGE_DOMAIN"
state: "present"
wait: true
- ovirt.ovirt.ovirt_vm:
auth: "{{ ovirt_auth }}"
state: running
name: "vm.example.com"