VMware Cloud Director has secret not well known API only feature that allows to move vApps across Org VDCs while they are running.
This feature has been purposefully made for the NSX-V to NSX-T Migration Tool, but can be used for other use cases hence the reason here to shed more lights on it.
API method POST /VDC/{id}/action/moveVApp.
The API method is using the target Org VDC endpoint with quite elaborate payload that must describe which vApp is being moved, how will the target network configuration look like (obviously parent Org VDC networks will change) and what storage, compute or placement policies will be used by every vApp VM at the target.
API POST call is executed against target VDC. Example, we want to move server from VDC A to VDC B, then API call will be POST /VDC/<VDC B>/action/moveVApp.

API Headers
Content-Type: application/vnd.vmware.vcloud.MoveVAppParams+xml
Accept: application/*+xml;version=36.2
API Body
You should describe:
- vApp UID
- Target network name and parameters
- VM UID
- Target network name and parameters
- Storage profile
Parameters can be extended by – storage, compute or placement policies will be used by every vApp VM at the target.
<?xml version="1.0"?>
<MoveVAppParams xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ns7="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ns8="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:ns9="http://www.vmware.com/schema/ovf">
<Source href="https://vcd.tetcloud.com/api/vApp/vapp-07957434-e638-491d-871e-83297a689f2a"/>
<NetworkConfigSection>
<ns7:Info>The configuration parameters for logical networks</ns7:Info>
<NetworkConfig networkName="tetcloud-default-internal-network">
<Configuration>
<IpScopes>
<IpScope>
<IsInherited>false</IsInherited>
<Gateway>192.168.100.1</Gateway>
<Netmask>255.255.255.0</Netmask>
<SubnetPrefixLength>24</SubnetPrefixLength>
<Dns1>1.1.1.1</Dns1>
<Dns2>8.8.8.8</Dns2>
<IsEnabled>true</IsEnabled>
<IpRanges>
<IpRange>
<StartAddress>192.168.100.2</StartAddress>
<EndAddress>192.168.100.100</EndAddress>
</IpRange>
</IpRanges>
</IpScope>
</IpScopes>
<FenceMode>natRouted</FenceMode>
<RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>
<SubInterface>false</SubInterface>
<DistributedInterface>false</DistributedInterface>
<GuestVlanAllowed>false</GuestVlanAllowed>
<Connected>true</Connected>
<DualStackNetwork>false</DualStackNetwork>
</Configuration>
<IsDeployed>true</IsDeployed>
</NetworkConfig>
</NetworkConfigSection>
<SourcedItem>
<Source href="https://vcd.tetcloud.com/api/vApp/vm-71eebd42-54dc-41f3-86d5-da9de25c4eff"/>
<InstantiationParams>
<NetworkConnectionSection>
<ns7:Info>Network Connection Section</ns7:Info>
<PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
<NetworkConnection network="tetcloud-default-internal-network" needsCustomization="false">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress>192.168.100.10</IpAddress>
<IpType>IPV4</IpType>
<IsConnected>true</IsConnected>
<MACAddress>00:50:56:01:18:1c</MACAddress>
<IpAddressAllocationMode>POOL</IpAddressAllocationMode>
<SecondaryIpAddressAllocationMode>NONE</SecondaryIpAddressAllocationMode>
<NetworkAdapterType>VMXNET3</NetworkAdapterType>
</NetworkConnection>
</NetworkConnectionSection>
</InstantiationParams>
<StorageProfile href="https://vcd.tetcloud.com/api/vdcStorageProfile/0c64bbc9-5d08-4f57-9c00-ec5720c61e00"/>
</SourcedItem>
</MoveVAppParams>
Leave a Reply