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

vCD vApp VM Nic

Mukul Taneja edited this page Apr 27, 2021 · 6 revisions

Vapp VM NIC Example Usage

  1. Vapp VM NIC States

    • Create Vapp VM NIC
    
      - name: create vm nic
        vcd_vapp_vm_nic:
         vm_name: test_vm
         vapp: test_vapp
         vdc: test_vdc
         nics:
         - nic_id: 1
           network: acme_vapp_network
           ip_allocation_mode: MANUAL
           ip_address: "192.168.102.4"
           is_connected: True
           adapter_type: E1000
         - nic_id: 2
           network: acme_vapp_network
           ip_allocation_mode: MANUAL
           ip_address: "192.168.102.4"
           is_connected: True
           adapter_type: E1000
         state: present
    
    
    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
    • nics - (Required) List of NICs
      • nic_id - (Required) Nic id
      • network - (Required) name of the vApp network to connect
      • ip_allocation_mode - (Required) Set Ip Allocation Mode (DHCP/MANUAL/POOL) for newly added Nic
      • ip_address - (Required) Set Ip Address of newly added Nic
      • is_primary - (Required) True, if its a primary nic of the VM
      • is_connected - (Required) True, if the nic has to be connected
      • adapter_type - (Required) nic adapter type.One of NetworkAdapterType values
    • state == "present" (Required) to create nic

    • Update vapp vm nic
    
     - name: update nic
       vcd_vapp_vm_nic:
        vm_name: test_vm
        vapp: test_vapp
        vdc: test_vdc
        nics:
        - nic_id: 1
          is_connected: True
        - nic_id: 2
          is_connected: False
        state: update
    
    
    • 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
    • nics - (Required) List of NICs
      • nic_id - (Optional) Nic id. Default is 0
      • network - (Required) name of the vApp network to connect
      • ip_allocation_mode - (Optional) Set Ip Allocation Mode (DHCP/MANUAL/POOL). Default is None
      • ip_address - (Optional) Set Ip Address of Nic. Default is None
      • is_primary - (Optional) True, if its a primary nic of the VM. Default is False
      • is_connected - (Optional) True, if the nic has to be connected. Default is False
      • adapter_type - (Optional) nic adapter type.One of NetworkAdapterType values. Default is None
    • state == "update" (Required) to update nic

    • Delete Vapp VM NIC
    
      - name: delete nic
        vcd_vapp_vm_nic:
         vm_name: test_vm
         vapp: test_vapp
         vdc: test_vdc
         nics:
         - nic_id: 1
         - nic_id: 2
         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
    • nics - (Required) List of NICs
      • nic_id - (Required) Nic id
    • state == "absent" (Required) to delete nic

  2. Note: VM should be in POWERED OFF state before deleting Nic(s).

  3. Vapp VM NIC Operations

    • Read vapp vm nics
    
     - name: read nics
       vcd_vapp_vm_nic:
        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 available Nics