Pages

Sunday, August 15, 2021

Moving a vApp to another VCD one vCenter across all clusters.

The main issue this API will solve is preserving the UUID of the vApp once moved. 

Today, move and clone vApp create an entirely new vApp at the target, changing the UUID of the vApp.
 
vCAV and other monitoring tools rely on the vApp UUID for tracking purposes. This normally wouldn't be an issue for such tools, but since they will be moving from one PVDC to another for NSX migration, the solution needs to preserve UUIDs of vApps. The scope of the move is contained within one vCenter, at least across clusters. 

 How-to-Use 

The API is under /api/vdc/{vdcId}/action/moveVApp 
 
The vdcId is of the target VDC where the vApp should be moved. 

The payload is of type MoveVAppParams 

The only vApp Section type allowed in the NetworkConfigSection which is used to define the form of any vApp Networks desired at the target VDC in the process of moving

Every VM in the vApp must be accounted for in the payload as a SourcedCompositionItem, or a BadRequestException will be thrown.

Below is an example of a payload moving a vApp with the following config: 

vApp (ID: ec6e2254-63b1-49f3-9c53-2f63e071509f) has two VMs (ID: 7b5dd00d-0f93-47a5-b29c-dbc4815bd377 and b757f667-148c-4a53-b428-1179bf77a6e5)

Each storage profile specified for the VMs is the target VDC's "Any" profile

Specifying a new vApp Network called Cluster1-Ext that is attached to an OrgVDC Network (specified as ParentNetwork in the payload) at the target VDC

Each VM is connected to Cluster1-Ext

POST https://vcd-lab.local/api/vdc/ec6e2254-63b1-49f3-9c53-2f63e071509f/action/moveVApp

Content-Type:application/vnd.vmware.vcloud.MoveVAppParams+xml
Accept:application/*+xml;version=36.0

<?xml version="1.0"?>
<root:MoveVAppParams xmlns:root="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">
  <root:Source href="https://vcd-lab.local/api/vApp/vapp-ec6e2254-63b1-49f3-9c53-2f63e071509f"/>
   
  <root:NetworkConfigSection>
    <ns7:Info>The configuration parameters for logical networks</ns7:Info>
      <root:NetworkConfig networkName="Cluster1-Ext">
      <root:Description/>
      <root:Configuration>
          <root:IpScopes>
            <root:IpScope>
              <root:IsInherited>true</root:IsInherited>
              <root:Gateway>1.1.1.1</root:Gateway>
              <root:SubnetPrefixLength>24</root:SubnetPrefixLength>
              <root:Dns1/>
              <root:Dns2/>
              <root:DnsSuffix/>
              <root:IsEnabled>true</root:IsEnabled>
            </root:IpScope>
          </root:IpScopes>
          <root:ParentNetwork href="https://vcd-lab.local/api/admin/network/3f0a78d7-a843-4493-aabf-dd752ffee223" id="urn:vcloud:network:3f0a78d7-a843-4493-aabf-dd752ffee223" name="Cluster1-Ext"/>
          <root:FenceMode>bridged</root:FenceMode>
          <root:AdvancedNetworkingEnabled>true</root:AdvancedNetworkingEnabled>
      </root:Configuration>
      <root:IsDeployed>false</root:IsDeployed>
    </root:NetworkConfig>
  </root:NetworkConfigSection>
   
  <root:SourcedItem>
    <root:Source href="https://vcd-lab.local/api/vApp/vm-7b5dd00d-0f93-47a5-b29c-dbc4815bd377"/>
    <root:InstantiationParams>
      <root:NetworkConnectionSection>
        <ns7:Info>Network Connection Section</ns7:Info>
        <root:PrimaryNetworkConnectionIndex>0</root:PrimaryNetworkConnectionIndex>
        <root:NetworkConnection network="Cluster1-Ext">
          <root:NetworkConnectionIndex>0</root:NetworkConnectionIndex>
          <root:IsConnected>true</root:IsConnected>
          <root:MACAddress>00:50:56:01:00:00</root:MACAddress>
          <root:IpAddressAllocationMode>POOL</root:IpAddressAllocationMode>
          <root:NetworkAdapterType>FLEXIBLE</root:NetworkAdapterType>
        </root:NetworkConnection>
      </root:NetworkConnectionSection>
    </root:InstantiationParams>
    <root:StorageProfile href="https://vcd-lab.local/api/vdcStorageProfile/7e662275-3f73-4b42-b05d-fd1df0ba9fc6"/>
  </root:SourcedItem>
   
  <root:SourcedItem>
    <root:Source href="https://vcd-lab.local/api/vApp/vm-b757f667-148c-4a53-b428-1179bf77a6e5"/>
    <root:InstantiationParams>
      <root:NetworkConnectionSection>
        <ns7:Info>Network Connection Section</ns7:Info>
        <root:PrimaryNetworkConnectionIndex>0</root:PrimaryNetworkConnectionIndex>
        <root:NetworkConnection network="Cluster1-Ext">
          <root:NetworkConnectionIndex>0</root:NetworkConnectionIndex>
          <root:IsConnected>true</root:IsConnected>
          <root:MACAddress>00:50:56:01:00:01</root:MACAddress>
          <root:IpAddressAllocationMode>POOL</root:IpAddressAllocationMode>
          <root:NetworkAdapterType>FLEXIBLE</root:NetworkAdapterType>
        </root:NetworkConnection>
      </root:NetworkConnectionSection>
    </root:InstantiationParams>
    <root:StorageProfile href="https://vcd-lab.local/api/vdcStorageProfile/7e662275-3f73-4b42-b05d-fd1df0ba9fc6"/>
  </root:SourcedItem>
   
</root:MoveVAppParams>

There are also cases where a VM's disk span multiple storage policies (if overrideVmDefault is true for the disk). Providing a payload like the one above will fail because the disks' storage profiles will be of the source VDC. 

To properly invoke Move vApp, a Disk Section must be provided in the SourcedItem that specifies the storage profiles of each disk (profiles must be of the target VDC). 

An easy way to fetch the body is to do a GET on either the VM in question or vApp containing the VM and copying the DiskSection of the VmSpecSection (which is a further subsection of InstantiationParams), only modifying the storage profiles and setting Modified = true in VmSpecSection's attribute.

Below is an example of such a payload

POST https://vcd-lab.local/api/vdc/ec6e2254-63b1-49f3-9c53-2f63e071509f/action/moveVApp

Content-Type:application/vnd.vmware.vcloud.MoveVAppParams+xml
Accept:application/*+xml;version=36.0

<?xml version="1.0"?>
<root:MoveVAppParams xmlns:root="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">
  <root:Source href="https://vcd-lab.local/api/vApp/vapp-82a999b2-295f-4f63-843d-74a4732d82e1"/>
   
  <root:NetworkConfigSection>
    <ns7:Info>The configuration parameters for logical networks</ns7:Info>
      <root:NetworkConfig networkName="Cluster1-Ext">
      <root:Description/>
      <root:Configuration>
          <root:IpScopes>
            <root:IpScope>
              <root:IsInherited>true</root:IsInherited>
              <root:Gateway>1.1.1.1</root:Gateway>
              <root:SubnetPrefixLength>24</root:SubnetPrefixLength>
              <root:Dns1/>
              <root:Dns2/>
              <root:DnsSuffix/>
              <root:IsEnabled>true</root:IsEnabled>
            </root:IpScope>
          </root:IpScopes>
          <root:ParentNetwork href="https://vcd-lab.local/api/admin/network/3f0a78d7-a843-4493-aabf-dd752ffee223" id="urn:vcloud:network:3f0a78d7-a843-4493-aabf-dd752ffee223" name="Cluster1-Ext"/>
          <root:FenceMode>bridged</root:FenceMode>
          <root:AdvancedNetworkingEnabled>true</root:AdvancedNetworkingEnabled>
      </root:Configuration>
      <root:IsDeployed>false</root:IsDeployed>
    </root:NetworkConfig>
  </root:NetworkConfigSection>
   
  <root:SourcedItem>
    <root:Source href="https://vcd-lab.local/api/vApp/vm-5661a002-04a6-47d5-bc32-7d506210376e"/>
        <root:InstantiationParams>
           <root:VmSpecSection Modified="true">
           <ns7:Info/>
              <root:DiskSection>
                <root:DiskSettings>
                    <root:DiskId>3001</root:DiskId>
                    <root:SizeMb>4</root:SizeMb>
                    <root:UnitNumber>1</root:UnitNumber>
                    <root:BusNumber>0</root:BusNumber>
                    <root:AdapterType>1</root:AdapterType>
                    <root:ThinProvisioned>false</root:ThinProvisioned>
                    <root:StorageProfile href="https://vcd-lab.local/api/vdcStorageProfile/7e662275-3f73-4b42-b05d-fd1df0ba9fc6" id="urn:vcloud:vdcstorageProfile:7e662275-3f73-4b42-b05d-fd1df0ba9fc6" name="*" type="application/vnd.vmware.vcloud.vdcStorageProfile+xml"/>
                    <root:overrideVmDefault>true</root:overrideVmDefault>
                    <root:iops>0</root:iops>
                    <root:VirtualQuantityUnit>byte</root:VirtualQuantityUnit>
                    <root:resizable>true</root:resizable>
                    <root:encrypted>false</root:encrypted>
                </root:DiskSettings>
                <root:DiskSettings>
                    <root:DiskId>3002</root:DiskId>
                    <root:SizeMb>4</root:SizeMb>
                    <root:UnitNumber>0</root:UnitNumber>
                    <root:BusNumber>1</root:BusNumber>
                    <root:AdapterType>1</root:AdapterType>
                    <root:ThinProvisioned>false</root:ThinProvisioned>
                    <root:StorageProfile href="https://vcd-lab.local/api/vdcStorageProfile/7e662275-3f73-4b42-b05d-fd1df0ba9fc6" id="urn:vcloud:vdcstorageProfile:7e662275-3f73-4b42-b05d-fd1df0ba9fc6" name="*" type="application/vnd.vmware.vcloud.vdcStorageProfile+xml"/>
                    <root:overrideVmDefault>true</root:overrideVmDefault>
                    <root:iops>0</root:iops>
                    <root:VirtualQuantityUnit>byte</root:VirtualQuantityUnit>
                    <root:resizable>true</root:resizable>
                    <root:encrypted>false</root:encrypted>
                </root:DiskSettings>
              </root:DiskSection>
              <root:HardwareVersion href="https://vcd-lab.local/api/vdc/c85266ae-b7f0-4a6e-86c8-44acfcd89378/hwv/vmx-09" type="application/vnd.vmware.vcloud.virtualHardwareVersion+xml">vmx-09</root:HardwareVersion>
          </root:VmSpecSection>
       </root:InstantiationParams>
    <root:StorageProfile href="https://vcd-lab.local/api/vdcStorageProfile/7e662275-3f73-4b42-b05d-fd1df0ba9fc6"/>
  </root:SourcedItem>
   
</root:MoveVAppParams>

That's it.

Monday, February 1, 2021

VCAP-CMA Design 2021 certification - Passed

Three weeks ago I finally passed the VCAP-CMA Design 2021 certification. I am delighted to share that I passed the exam with a score of 300. The exam code is 3V0-732 with some questions on mapping (drag & drop) and design scenarios. It has a total of 60 questions with a duration of 135 minutes.

Sadly the experience with VCAP CMA Design exam was one of the worst I've had when doing exams. 

First, I passed the exam on the second attempt with a score of 300 out of 500 where 300 is required to pass. Yes, I barely passed. But pass is pass.

Second, the exam will test your core basic concepts on vRealize Automation but with version 7.2!!!.  Then, you need to go through 7.2 reference architecture and foundation concepts.  I was not working with vRA 7.x anymore in at least one year and half. Actually I'm working with vRA 8.x. Then I needed to remember concepts.

Third, and the worst part,  even I passed the VCAP-CMA exam and I was waiting for the badge, it never came. I asked to certification VMware team why, and they told me the bad news: My old VCP7-CMA certification was not valid anymore. Then I needed to pass the new Professional VMware vRealize Automation 8.1 (2V0-31.20) exam to validate the VCAP CMA Design exam. Yes, I didn't read the little letters. The only good thing is new exam is based on vRA 8.1.

I had to schedule the new exam last week, and, yes, I passed too. I had 467 score out of 500. 

Finally I received both badges back to back. Good thing.

 


My last comment is about the exam delivery method. Right now (due to pandemic) many of them are proctored and remote.  These both exams were remote using my laptop on my home.  You needed to download an App for Mac on my computer. The App detected any application opens or running, it forces to close them in that case. Also you need to keep the camera and mic open all time or the exam is canceled immediately. Same if they listen any voice in room. First time was a little annoying but second time was comfortable. 

I have plans to make the VCAP CMA Deploy 2021 on March (to get VCIX-CMA 2021). I hope but the bad news is a proctored exam in site (no remote). 

Regards