Quantcast
Viewing all articles
Browse latest Browse all 170134

Re: Accessing VM Properties when Instantiating from VApp Template via AMQP

Yes, I get a reference object that I am unsure how to access. If I use Orchestrator to access the object via Orchestrator Script, It comes up as a VclReference. I am unable to extract the name or id from this object (the fields in the VclReference object return null).

 

 

I will roughly how far I can get below by printing out the toXML's right before I have no idea what to do.

 

Converting the Storage Profile Object (found by going to each vm in the vTemplate object, calling getStorageProfileReference(), then using toXml() gives me:

<ns6:Link xmlns="http://www.vmware.com/vcloud/versions" xmlns:ns2="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ns3="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:ns4="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ns5="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:ns6="http://www.vmware.com/vcloud/v1.5" xmlns:ns7="http://www.vmware.com/schema/ovf" xmlns:ns8="http://schemas.dmtf.org/ovf/environment/1" xmlns:ns9="http://www.vmware.com/vcloud/extension/v1.5" rel="storageProfile" type="application/vnd.vmware.vcloud.vdcStorageProfile+xml" href="https://usyp-vcd.testlab.corp/api/vdcStorageProfile/9cb95fe1-b76d-4745-8389-a3e53f1d7a7a"/>

 

The Template toXml() looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ns6:VAppTemplate xmlns="http://www.vmware.com/vcloud/versions" xmlns:ns2="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ns3="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:ns4="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ns5="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:ns6="http://www.vmware.com/vcloud/v1.5" xmlns:ns7="http://www.vmware.com/schema/ovf" xmlns:ns8="http://schemas.dmtf.org/ovf/environment/1" xmlns:ns9="http://www.vmware.com/vcloud/extension/v1.5" ovfDescriptorUploaded="true" goldMaster="true" status="8" name="win2012_vAPP" id="urn:vcloud:vapptemplate:e01754e4-4085-4564-b8a0-e7fdee131342" type="application/vnd.vmware.vcloud.vAppTemplate+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342">

    <ns6:Link rel="up" type="application/vnd.vmware.vcloud.vdc+xml" href="https://vcd.testlab.corp/api/vdc/6042c8a2-8cd7-49df-8e7e-376b371ae4e0"/>

    <ns6:Link rel="catalogItem" type="application/vnd.vmware.vcloud.catalogItem+xml" href="https://vcd.testlab.corp/api/catalogItem/d7f2bb69-f33d-48d2-bb2b-6018c315bc1b"/>

    <ns6:Link rel="remove" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342"/>

    <ns6:Link rel="edit" type="application/vnd.vmware.vcloud.vAppTemplate+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342"/>

    <ns6:Link rel="enable" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/action/enableDownload"/>

    <ns6:Link rel="disable" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/action/disableDownload"/>

    <ns6:Link rel="ovf" type="text/xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/ovf"/>

    <ns6:Link rel="storageProfile" type="application/vnd.vmware.vcloud.vdcStorageProfile+xml" href="https://vcd.testlab.corp/api/vdcStorageProfile/9cb95fe1-b76d-4745-8389-a3e53f1d7a7a"/>

    <ns6:Link rel="down" type="application/vnd.vmware.vcloud.owner+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/owner"/>

    <ns6:Link rel="down" type="application/vnd.vmware.vcloud.metadata+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/metadata"/>

    <ns6:Link rel="down" type="application/vnd.vmware.vcloud.productSections+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/productSections/"/>

    <ns6:Description></ns6:Description>

    <ns6:Owner type="application/vnd.vmware.vcloud.owner+xml">

        <ns6:User type="application/vnd.vmware.admin.user+xml" name="system" href="https://vcd.testlab.corp/api/admin/user/1077b17f-2624-4ed4-b813-4e8f6e11eff9"/>

    </ns6:Owner>

    <ns6:Children>

        <ns6:Vm goldMaster="true" name="vwin2012" id="urn:vcloud:vm:5375f03c-8322-45e9-89d0-4cf206ffd717" type="application/vnd.vmware.vcloud.vm+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vm-5375f03c-8322-45e9-89d0-4cf206ffd717">

            <ns6:VCloudExtension required="false">

                <ns9:VmVimInfo>

                    <ns9:VmVimObjectRef>

                        <ns9:VimServerRef type="application/vnd.vmware.admin.vmwvirtualcenter+xml" name="vcdCenter" href="https://vcd.testlab.corp/api/admin/extension/vimServer/ec647564-ae7b-4759-9e8a-4148764cfd11"/>

                        <ns9:MoRef>vm-271</ns9:MoRef>

                        <ns9:VimObjectType>VIRTUAL_MACHINE</ns9:VimObjectType>

                    </ns9:VmVimObjectRef>

                    <ns9:DatastoreVimObjectRef>

                        <ns9:VimServerRef type="application/vnd.vmware.admin.vmwvirtualcenter+xml" name="vcdCenter" href="https://vcd.testlab.corp/api/admin/extension/vimServer/ec647564-ae7b-4759-9e8a-4148764cfd11"/>

                        <ns9:MoRef>datastore-63</ns9:MoRef>

                        <ns9:VimObjectType>DATASTORE</ns9:VimObjectType>

                    </ns9:DatastoreVimObjectRef>

                    <ns9:HostVimObjectRef>

                        <ns9:VimServerRef type="application/vnd.vmware.admin.vmwvirtualcenter+xml" name="vcdCenter" href="https://vcd.testlab.corp/api/admin/extension/vimServer/ec647564-ae7b-4759-9e8a-4148764cfd11"/>

                        <ns9:MoRef>host-62</ns9:MoRef>

                        <ns9:VimObjectType>HOST</ns9:VimObjectType>

                    </ns9:HostVimObjectRef>

                    <ns9:VirtualDisksMaxChainLength>3</ns9:VirtualDisksMaxChainLength>

                </ns9:VmVimInfo>

            </ns6:VCloudExtension>

            <ns6:Link rel="up" type="application/vnd.vmware.vcloud.vAppTemplate+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342"/>

            <ns6:Link rel="storageProfile" type="application/vnd.vmware.vcloud.vdcStorageProfile+xml" href="https://vcd.testlab.corp/api/vdcStorageProfile/9cb95fe1-b76d-4745-8389-a3e53f1d7a7a"/>

            <ns6:Link rel="relocate" type="application/vnd.vmware.vcloud.relocateVmParams+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vm-5375f03c-8322-45e9-89d0-4cf206ffd717/action/relocate"/>

            <ns6:Link rel="consolidate" href="https://vcd.testlab.corp/api/vAppTemplate/vm-5375f03c-8322-45e9-89d0-4cf206ffd717/action/consolidate"/>

            <ns6:Link rel="shadowVms" type="application/vnd.vmware.vcloud.shadowVms+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vm-5375f03c-8322-45e9-89d0-4cf206ffd717/shadowVms"/>

            <ns6:Link rel="down" type="application/vnd.vmware.vcloud.metadata+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vm-5375f03c-8322-45e9-89d0-4cf206ffd717/metadata"/>

            <ns6:Link rel="down" type="application/vnd.vmware.vcloud.productSections+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vm-5375f03c-8322-45e9-89d0-4cf206ffd717/productSections/"/>

            <ns6:Description>Windows 2012 server template</ns6:Description>

            <ns6:NetworkConnectionSection type="application/vnd.vmware.vcloud.networkConnectionSection+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vm-5375f03c-8322-45e9-89d0-4cf206ffd717/networkConnectionSection/" ns2:required="false">

                <ns2:Info>Specifies the available VM network connections</ns2:Info>

                <ns6:PrimaryNetworkConnectionIndex>0</ns6:PrimaryNetworkConnectionIndex>

                <ns6:NetworkConnection network="AdminOrg-vDCInterNet" needsCustomization="true">

                    <ns6:NetworkConnectionIndex>0</ns6:NetworkConnectionIndex>

                    <ns6:IsConnected>true</ns6:IsConnected>

                    <ns6:MACAddress>00:50:56:01:01:09</ns6:MACAddress>

                    <ns6:IpAddressAllocationMode>DHCP</ns6:IpAddressAllocationMode>

                </ns6:NetworkConnection>

            </ns6:NetworkConnectionSection>

            <ns6:GuestCustomizationSection type="application/vnd.vmware.vcloud.guestCustomizationSection+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vm-5375f03c-8322-45e9-89d0-4cf206ffd717/guestCustomizationSection/" ns2:required="false">

                <ns2:Info>Specifies Guest OS Customization Settings</ns2:Info>

                <ns6:Enabled>true</ns6:Enabled>

                <ns6:ChangeSid>false</ns6:ChangeSid>

                <ns6:VirtualMachineId>5375f03c-8322-45e9-89d0-4cf206ffd717</ns6:VirtualMachineId>

                <ns6:JoinDomainEnabled>false</ns6:JoinDomainEnabled>

                <ns6:UseOrgSettings>false</ns6:UseOrgSettings>

                <ns6:AdminPasswordEnabled>false</ns6:AdminPasswordEnabled>

                <ns6:AdminPasswordAuto>false</ns6:AdminPasswordAuto>

                <ns6:AdminPassword>P@ss-w0rd</ns6:AdminPassword>

                <ns6:ResetPasswordRequired>false</ns6:ResetPasswordRequired>

                <ns6:ComputerName>vwin2012</ns6:ComputerName>

            </ns6:GuestCustomizationSection>

            <ns6:VAppScopedLocalId>d81713ca-5648-45e8-87ec-f7bcafdc91e1</ns6:VAppScopedLocalId>

            <ns6:DateCreated>2013-03-29T13:19:12.676-07:00</ns6:DateCreated>

        </ns6:Vm>

    </ns6:Children>

    <ns2:NetworkSection ns6:href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/networkSection/" ns6:type="application/vnd.vmware.vcloud.networkSection+xml">

        <ns2:Info>The list of logical networks</ns2:Info>

        <ns2:Network ns2:name="AdminOrg-vDCInterNet">

            <ns2:Description></ns2:Description>

        </ns2:Network>

    </ns2:NetworkSection>

    <ns6:NetworkConfigSection type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/networkConfigSection/" ns2:required="false">

        <ns2:Info>The configuration parameters for logical networks</ns2:Info>

        <ns6:NetworkConfig networkName="AdminOrg-vDCInterNet">

            <ns6:Description></ns6:Description>

            <ns6:Configuration>

                <ns6:IpScopes>

                    <ns6:IpScope>

                        <ns6:IsInherited>true</ns6:IsInherited>

                        <ns6:Gateway>10.15.16.254</ns6:Gateway>

                        <ns6:Netmask>255.255.255.0</ns6:Netmask>

                        <ns6:Dns1>10.15.16.10</ns6:Dns1>

                        <ns6:DnsSuffix>test.vlab</ns6:DnsSuffix>

                        <ns6:IsEnabled>true</ns6:IsEnabled>

                        <ns6:IpRanges>

                            <ns6:IpRange>

<ns6:StartAddress>10.15.16.192</ns6:StartAddress>

<ns6:EndAddress>10.15.16.223</ns6:EndAddress>

                            </ns6:IpRange>

                        </ns6:IpRanges>

                    </ns6:IpScope>

                </ns6:IpScopes>

                <ns6:ParentNetwork name="AdminOrg-vDCInterNet" href=""/>

                <ns6:FenceMode>bridged</ns6:FenceMode>

                <ns6:RetainNetInfoAcrossDeployments>false</ns6:RetainNetInfoAcrossDeployments>

            </ns6:Configuration>

            <ns6:IsDeployed>false</ns6:IsDeployed>

        </ns6:NetworkConfig>

    </ns6:NetworkConfigSection>

    <ns6:LeaseSettingsSection type="application/vnd.vmware.vcloud.leaseSettingsSection+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/leaseSettingsSection/" ns2:required="false">

        <ns2:Info>Lease settings section</ns2:Info>

        <ns6:Link rel="edit" type="application/vnd.vmware.vcloud.leaseSettingsSection+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/leaseSettingsSection/"/>

        <ns6:StorageLeaseInSeconds>2592000</ns6:StorageLeaseInSeconds>

        <ns6:StorageLeaseExpiration>2013-05-30T14:12:05.379-07:00</ns6:StorageLeaseExpiration>

    </ns6:LeaseSettingsSection>

    <ns6:CustomizationSection type="application/vnd.vmware.vcloud.customizationSection+xml" href="https://vcd.testlab.corp/api/vAppTemplate/vappTemplate-e01754e4-4085-4564-b8a0-e7fdee131342/customizationSection/" goldMaster="true" ns2:required="false">

        <ns2:Info>VApp template customization section</ns2:Info>

        <ns6:CustomizeOnInstantiate>true</ns6:CustomizeOnInstantiate>

    </ns6:CustomizationSection>

    <ns6:DateCreated>2013-03-29T13:19:12.676-07:00</ns6:DateCreated>

</ns6:VAppTemplate>

 

 

Two more questions:

If a user modifies the storage profile during vApp Template Instantiation, will it be reflected here?

How do I know what objects are available to me during each blocking task? I knew there was a vApp object since it is in the "default" location, but would have never known to look for the vTemplate object without seeing that it was accessed in the notifications workflow package


Viewing all articles
Browse latest Browse all 170134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>