VMware, Inc. 77
Chapter 5 Datacenter Operations
ReconfigurationlinksinthebodyofaVmcanappearintwoplaces:
IndividualLinkelementsintheovf:Itemelementsdefiningcpuandmemory.Theselinksappearinthe
ovf:Itemitself,andhavetype="application/vnd.vmware.vcloud.rasdItem+xml".
Linkstogroupsofrelatedovf:Itemelements(disks,networkcards,andmediadevices).Theselinks
appearattheendoftheovf:VirtualHardwareSection,andhave
type="application/vnd.vmware.vcloud.rasdItemsList+xml".
Retrieve or Modify the Network Connection of a Virtual Machine
Example 5‐13retrievestheNetworkConnectionSectionconfigurationoftheVmshowninExample 5‐12.
Example 5‐14modifiesthesectionandusestheURLintheeditlinkfromthatsectiontoapplythechangesto
theVm.
Example 5-13. Retrieve the Network Connection of a Virtual Machine
Request:
GET http://vcloud.example.com/api/v1.0/vApp/vm-4/networkConnectionSection/
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.networkconnectionsection+xml
...
<NetworkConnectionSection ...
href="http://vcloud.example.com/api/v1.0/vApp/vm-4/networkConnectionSection/" ...>
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
<NetworkConnection network="vAppNetwork">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress>10.147.122.134</IpAddress>
<IsConnected>false</IsConnected>
<MACAddress>00:50:56:01:01:49</MACAddress>
<IpAddressAllocationMode>POOL</IpAddressAllocationMode>
</NetworkConnection>
<Link rel="edit" type="application/vnd.vmware.vcloud.networkConnectionSection+xml"
href="http://vcloud.example.com/api/v1.0/vApp/vm-4
networkConnectionSection/"/>
</NetworkConnectionSection>
ThemodifiedNetworkConnectionSectionintherequestbodychangesthevalueintheIpAddresselement.
Example 5-14. Modify the Network Connection of a Virtual Machine
Request:
PUT "http://vcloud.example.com/api/v1.0/vApp/vm-4/networkConnectionSection/
Content-type: application/vnd.vmware.vcloud.networkConnectionSection+xml
...
<NetworkConnectionSection ...
href="http://vcloud.example.com/api/v1.0/vApp/vm-4/networkConnectionSection/" ...>
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
<NetworkConnection network="vAppNetwork">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress>10.147.115.1</IpAddress>
<IsConnected>false</IsConnected>
<MACAddress>00:50:56:01:01:49</MACAddress>
<IpAddressAllocationMode>POOL</IpAddressAllocationMode>
</NetworkConnection>
</NetworkConnectionSection>