Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logical names of disks are not assigned as expected #751

Closed
denkk0 opened this issue Aug 21, 2024 · 1 comment
Closed

Logical names of disks are not assigned as expected #751

denkk0 opened this issue Aug 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@denkk0
Copy link

denkk0 commented Aug 21, 2024

SUMMARY

I am creating several disks, and I would expect them to get the logical names assigned as they are created in the playbook - sequentially. E.g.: disk_1 - /dev/sda, disk_2 - /dev/sdb, and so on... However what I am experiencing is that the logical names are not assigned sequentially nor deterministically. This has happened to me multiple times, and sometimes the logical names are in the correct order, but sometimes the order is mixed.

Versions:
ansible - 2.15.12
ovirt.ovirt collection - 3.2.0

COMPONENT NAME

ovirt.ovirt.ovirt_disk

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: "disk_1"
    bootable: true
    vm_name: "vm.example.com"
    auth: "{{ ovirt_auth }}"
    state: "present"
    wait: true

- ovirt.ovirt.ovirt_disk:
    name: "disk_2"
    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: "disk_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_vm:
    auth: "{{ ovirt_auth }}"
    state: running
    name: "vm.example.com"
EXPECTED RESULTS

When I inspect the VM's disks in the oVirt GUI, this is what I would expect

Alias Logical Name
disk_1 /dev/sda
disk_2 /dev/sdb
disk_3 /dev/sdc
ACTUAL RESULTS

However sometimes the logical names are switched, for example like this:

Alias Logical Name
disk_1 /dev/sda
disk_2 /dev/sdc
disk_3 /dev/sdb
@denkk0 denkk0 added the bug Something isn't working label Aug 21, 2024
@denkk0
Copy link
Author

denkk0 commented Sep 20, 2024

Later I found out that this is not an issue related to ovirt, or the collection in any way. The logical names /dev/sd* are assigned in order in which they are connected, so they are prone to change. One should rather use device ID, UUID or label for identifying a device.

@denkk0 denkk0 closed this as completed Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant