Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

vCD vApp VM Disk

mac edited this page Nov 16, 2020 · 8 revisions

Vapp VM Disk Example Usage

  1. Vapp VM Disk States

    • Create Vapp VM Disk
    
      - name: create vm disk
        vcd_vapp_vm_disk:
         vm_name: "test_vm"
         vapp: "test_vapp"
         vdc: "test_vdc"
         disks:
          - size: 1
            controller: lsilogic
            name: "Hard disk 1"
          - size: 1
            controller: VirtualSCSI
            name: "Hard disk 2"
         state: "present"
    
    

    Note: Name of the new disk and instance id are not in user control. They are going to be managed by Pyvcloud internally. But our module manages to return metadata such as new disk name/size/instance id which can be further used.

    Argument Reference
    • user - (Optional) - vCloud Director user name
    • password - (Optional) - vCloud Director password
    • org - (Optional) - vCloud Director org name to log into
    • host - (Optional) - vCloud Director host name
    • api_version - (Optional) - Pyvcloud API version
    • verify_ssl_certs - (Optional) - true to enforce to verify ssl certificate for each requests else false
    • vm_name - (Required) name of the VM
    • vapp - (Required) name of the vApp
    • vdc - (Required) name of the vdc
    • disks - (Optional) list of disk. It has information about disk size and disk controller
      • size - (Required) an integer disk size which internally converted in size of MB
      • controller - (Required) disk controller which needs to be attached with newly added disk. Possible values are `VirtualSCSI, lsilogic, lsilogicsas, buslogic`
      • name - (Optional) name of the new disk. The disk name has to be in the format "Hard disk <1/2/3...>".
    • state == "present" (Required) to create disk

    • Update vapp vm disk
    
     - name: update disk
       vcd_vapp_vm_disk:
        vm_name: "test_vm"
        vapp: "test_vapp"
        vdc: "test_vdc"
        disks:
          - name: Hard disk 1
            size: 3
        state: "update"
    
    

    Note: There are few things to take care before trying to update existing hard disks such as,
    a) Fast-provisioned hard drives can not be resized.
    b) Hard drives part of the VM snapshot may not be able to resize.

    Argument Reference
    • user - (Optional) - vCloud Director user name
    • password - (Optional) - vCloud Director password
    • org - (Optional) - vCloud Director org name to log into
    • host - (Optional) - vCloud Director host name
    • api_version - (Optional) - Pyvcloud API version
    • verify_ssl_certs - (Optional) - true to enforce to verify ssl certificate for each requests else false
    • vm_name - (Required) name of the VM
    • vapp - (Required) name of the vApp
    • vdc - (Required) name of the vdc
    • disks - (Optional) list of disk. It has information about disk size and disk controller
      • name - (Required) name of the disk
      • size - (Required) an integer disk size which internally converted in size of MB
    • state == "update" (Required) to update disk

    • Delete Vapp VM Disk
    
      - name: delete vm disk
        vcd_vapp_vm_disk:
         vm_name: "test_vm"
         vapp: "test_vapp"
         vdc: "test_vdc"
         disks:
           - name: 'Hard disk 3'
           - name: 'Hard disk 4'
         state: "absent"
    
    
    Argument Reference
    • user - (Optional) - vCloud Director user name
    • password - (Optional) - vCloud Director password
    • org - (Optional) - vCloud Director org name to log into
    • host - (Optional) - vCloud Director host name
    • api_version - (Optional) - Pyvcloud API version
    • verify_ssl_certs - (Optional) - true to enforce to verify ssl certificate for each requests else false
    • vm_name - (Required) name of the VM
    • vapp - (Required) name of the vApp
    • vdc - (Required) name of the vdc
    • disks - (Optional) list of disk. It has information about disk size and disk controller
      • name - (Required) name of the disk
    • state == "absent" (Required) to delete disk

  2. Vapp VM Disk Operations

    • Read vapp vm disk
    
     - name: read disks
       vcd_vapp_vm_disk:
        vm_name: "test_vm"
        vapp: "test_vapp"
        vdc: "test_vdc"
        operation: "read"
    
    
    • user - (Optional) - vCloud Director user name
    • password - (Optional) - vCloud Director password
    • org - (Optional) - vCloud Director org name to log into
    • host - (Optional) - vCloud Director host name
    • api_version - (Optional) - Pyvcloud API version
    • verify_ssl_certs - (Optional) - true to enforce to verify ssl certificate for each requests else false
    • vm_name - (Required) name of the VM
    • vapp - (Required) name of the vApp
    • vdc - (Required) name of the vdc
    • operation == "read" (Required) to read disks