Uploaded image for project: 'Ansible Cloud Automation'
  1. Ansible Cloud Automation
  2. ACA-1361

Adding disk to existing VM leaves it in invalid state

XMLWordPrintable

    • Important

      Trying to add a disk to an existing VM (in poweredoff state) using the provision_vm role

          - name: Add disk to VM
            ansible.builtin.import_role:
              name: cloud.vmware_ops.provision_vm
            vars:
              provision_vm_name: "qe-provision-vm-rhel-9"
              provision_vm_disk:
                - size_gb: 40
                  type: thin
                  datastore: "datastore1"
                - size_gb: 10
                  type: thin
                  datastore: "datastore1" 

      The role is executed without errors but the VM is left with a second disk with size 0, and trying to remove the VM gives the following error:

      TASK [cloud.vmware_ops.provision_vm : Manage VM] ************************************************
      fatal: [localhost]: FAILED! => {"changed": false, "msg": "Invalid virtual machine state.", "op": "destroy"} 

            dbarda Danielle Barda
            epassaro@redhat.com Elsa Passaro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: