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

[Bug] No disk resizing in module ntnx_vms_v2 #578

Open
Golgautier opened this issue Jan 20, 2025 · 0 comments
Open

[Bug] No disk resizing in module ntnx_vms_v2 #578

Golgautier opened this issue Jan 20, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Golgautier
Copy link

Describe the bug
With ntnx_vms, you were able to resize the system disk based on the image. With ntnx_vms_v2, you cannot.

Steps to reproduce the behavior:

Create a VM with this code (Note : I removed step to get network, cluster and other infos)...

  - name: create Vm
    ntnx_vms_v2:
      state: present
      name: "{{ vm_name}}"

      # Compute
      num_sockets: "{{ vm_vpu }}"
      num_cores_per_socket: 1
      memory_size_bytes: "{{ vm_ram * 1024 * 1024 * 1024}}"

      # Metadata
      description: "ansible_vm_description"
      categories:
        - ext_id: "{{ myCategory.response[0].ext_id }}"

      # Location
      cluster:
        ext_id: "{{ myCluster.response[0].ext_id }}"

      # Networks
      nics:
        - network_info:
            subnet:
              ext_id: "{{ mySubnet.response[0].ext_id }}"

      # Storage
      disks:
        - backing_info:
            vm_disk:
              disk_size_bytes: "{{ vm_os_disksize * 1024 * 1024 * 1024 }}"
              data_source:
                reference:
                  image_reference:
                    image_ext_id: "{{ myImage.response[0].ext_id }}"
        - backing_info:
            vm_disk:
              disk_size_bytes: "{{ vm_data_disksize * 1024 * 1024 * 1024 }}"
              storage_container:
                ext_id: "{{ myStorageContainer.response[0].container_ext_id }}"
      cd_roms:
        - disk_address:
            bus_type: IDE

      # Guest Customization
      guest_customization:
        config:
          cloudinit:
            datasource_type: CONFIG_DRIVE_V2
            cloud_init_script:
              user_data:
                value: "{{ lookup('file', 'cloud_init.yml') | b64encode }}"

      wait: true
    register: myVM

The line disk_size_bytes: "{{ vm_os_disksize * 1024 * 1024 * 1024 }}" won't have any effect. Disk size will be image size.

Expected behavior
If I ask for a 40GB disk, I should have a 40GB disk.

Additional context
N/A

@Golgautier Golgautier added the bug Something isn't working label Jan 20, 2025
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

2 participants