I am working with the API's of NSX and in this there is 1 API for Attach and Deattach a Virtual machine with from Logical Switch,var
In this API there is 1 tag of vnicUUID and i don't know that what is that ID and from how and where i can get the value of this ID.
If any one can help me in this matter.
The API which mentioned in document is:
Attach or Detach a Virtual Machine from a Logical Switch
You can attach or detach a virtual machine from a logical switch. To detach a virtual machine, leave the portgroupId tag empty.
Example 7-24. Attach or detach a virtual machine
Request:
POST https://NSX-Manager-IP-Address/api/2.0/vdn/virtualwires/vm/vnic
Request Body:
<com.vmware.vshield.vsm.inventory.dto.VnicDto>
<objectId>420388f4-1ce6-ef26-6643-fc6e8df99f2e.000</objectId>
<vnicUuid>420388f4-1ce6-ef26-6643-fc6e8df99f2e.000</vnicUuid>
<portgroupId>virtualwire-1</portgroupId>
</com.vmware.vshield.vsm.inventory.dto.VnicDto>
where the vnic uuid is generated in the following way:
vnicUUID = vm.instanceUUid + ʹ.ʹ + all chars except the first of the corresponding vnic virtualdevice id. The
virtual device id can be retrieved from:
https://API/mob/?moid=vm‐43&doPath=config%2ehardware%2edevice%5b4000%5d
Thanks.
One way of fetching this info will be like below
NSX Manager Central CLI
Note: Identify the host were Edge/VM is running
1. show cluster all details -> to get all Host-ID
2. show host host-id -> to get all VM-ID
3. show vm vm-id -> This will fetch vnic-id for the vm.
One way of fetching this info will be like below
NSX Manager Central CLI
Note: Identify the host were Edge/VM is running
1. show cluster all details -> to get all Host-ID
2. show host host-id -> to get all VM-ID
3. show vm vm-id -> This will fetch vnic-id for the vm.
Thanks Sreec. Sorry i busy in some other works. This is very helpful.
Can i get this vnicUUID by using any API call or programmatically ?