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] storage container without size specified is considered valid by VM Spec + API, failed vm creation in ntnx_vms #385

Closed
omarqureshi opened this issue Jul 21, 2023 · 1 comment
Assignees
Labels
1.9.1 Bug fixes & Improvements bug Something isn't working

Comments

@omarqureshi
Copy link

Describe the bug
If you create a VM with a storage container attached as disk and fail to provide a size for it, it initially succeeds (HTTP 202) but eventually fails (HTTP 500 from task list). The HTTP 500 is very vague and took me some time to figure out where it was happening by modifying entity._fetch_url to get at what was being sent to Prism Central's API

To Reproduce

    - ntnx_vms:
        state: present
        name: "{{ vm_name }}"
        timezone: UTC
        cluster:
          name: "{{ nutanix.cluster_name }}"
        vcpus: "{{ vcpus }}"
        cores_per_vcpu: "{{ cores_per_vcpu }}"
        memory_gb: "{{ memory_gb }}"
        networks:
          - is_connected: true
            subnet:
              name: "{{ nutanix.static_subnet_name }}"
        disks:
          - type: DISK
            bus: SCSI
            size_gb: "{{ ephemeral_disk_size_gb }}"
          - type: DISK
            bus: SCSI
            storage_container:
              name: "{{ storage_container_name }}"
          - type: CDROM
            bus: SATA
            clone_image:
              name: "{{ image_name }}"
        boot_config:
          boot_type: LEGACY
          boot_order:
            - CDROM
            - DISK
            - NETWORK

Stack trace
HTTP 500 without any context as to why it was failing

Expected behavior
The failure is right, however, this should have been caught when checking the yaml spec and not when attempting to create the VM. Probably need to change DefaultVMSpec to do this

Additional context
This probably extends to other disk attributes too, looking at DefaultVMSpec, this does not validate the shape of the disks list

@omarqureshi omarqureshi added the bug Something isn't working label Jul 21, 2023
@bhati-pradeep bhati-pradeep added the 1.9.0 Bug fixes and improvements label Sep 25, 2023
@bhati-pradeep bhati-pradeep added 1.9.3_triage Bug fixes & Improvements and removed 1.9.0 Bug fixes and improvements labels Aug 5, 2024
@george-ghawali
Copy link
Collaborator

The check has been already added in 1.9.1 release to error out when size in storage container based disk is not given. Hence, closing the ticket

@george-ghawali george-ghawali added 1.9.1 Bug fixes & Improvements and removed 1.9.3_triage Bug fixes & Improvements labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.9.1 Bug fixes & Improvements bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants