VMware Cloud Community
cfor
Expert
Expert
Jump to solution

instantiateVAppTemplate: how to set storage profile per VM at deployment time

Using the rest API to deploy a vApp, we would like at deployment time to change the storage profile of ONE of the VMs in the deployment (ie not use the default for one VM).  How to do this?  I do not see a section in the instantiateparams for storage.

Thank you

ChrisF (VCP4, VCP5, VCP-Cloud) - If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
cfor
Expert
Expert
Jump to solution

Figured it out.

"SourcedVmInstantiationParams" is the tag that needs to be added for each VM that you would like the profile changed on.  This has to be at the SAME level as "SOURCE"

ie:

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

<InstantiateVAppTemplateParams

   xmlns="http://www.vmware.com/vcloud/v1.5"

   name="test"

   deploy="false"

   powerOn="false"

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

   xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">

   <Description>Testing</Description>

   <InstantiationParams>

      <LeaseSettingsSection type="application/vnd.vmware.vcloud.leaseSettingsSection+xml">

         <ovf:Info>Lease Settings</ovf:Info>

         <StorageLeaseInSeconds>172800</StorageLeaseInSeconds>

         <StorageLeaseExpiration>2017-11-11T08:08:16.438-07:00</StorageLeaseExpiration>

      </LeaseSettingsSection>

   </InstantiationParams>

   <Source href="https://something/api/vAppTemplate/vappTemplate-1234967d-cbfd-4d6a-b9ac-41a9b7075062" />

   <SourcedVmInstantiationParams>

      <Source href="https://something/api/vAppTemplate/vm-12345015-e960-1195-96ae-8b8ad50b7ba0" name="serverb01" />

      <StorageProfile href="https://something/api/vdcStorageProfile/12345cfd-37a2-424d-acd6-d3624463e542" name="Temp Deployment"/>

   </SourcedVmInstantiationParams>

   <AllEULAsAccepted>true</AllEULAsAccepted>

</InstantiateVAppTemplateParams>

ChrisF (VCP4, VCP5, VCP-Cloud) - If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

View solution in original post

Reply
0 Kudos
2 Replies
cfor
Expert
Expert
Jump to solution

Figured it out.

"SourcedVmInstantiationParams" is the tag that needs to be added for each VM that you would like the profile changed on.  This has to be at the SAME level as "SOURCE"

ie:

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

<InstantiateVAppTemplateParams

   xmlns="http://www.vmware.com/vcloud/v1.5"

   name="test"

   deploy="false"

   powerOn="false"

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

   xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">

   <Description>Testing</Description>

   <InstantiationParams>

      <LeaseSettingsSection type="application/vnd.vmware.vcloud.leaseSettingsSection+xml">

         <ovf:Info>Lease Settings</ovf:Info>

         <StorageLeaseInSeconds>172800</StorageLeaseInSeconds>

         <StorageLeaseExpiration>2017-11-11T08:08:16.438-07:00</StorageLeaseExpiration>

      </LeaseSettingsSection>

   </InstantiationParams>

   <Source href="https://something/api/vAppTemplate/vappTemplate-1234967d-cbfd-4d6a-b9ac-41a9b7075062" />

   <SourcedVmInstantiationParams>

      <Source href="https://something/api/vAppTemplate/vm-12345015-e960-1195-96ae-8b8ad50b7ba0" name="serverb01" />

      <StorageProfile href="https://something/api/vdcStorageProfile/12345cfd-37a2-424d-acd6-d3624463e542" name="Temp Deployment"/>

   </SourcedVmInstantiationParams>

   <AllEULAsAccepted>true</AllEULAsAccepted>

</InstantiateVAppTemplateParams>

ChrisF (VCP4, VCP5, VCP-Cloud) - If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
mjha
Hot Shot
Hot Shot
Jump to solution

Thanks for sharing the solution. It will be very helpful when scripting the VM deployment tasks

Please consider marking this answer "correct" or "helpful" if you think your query have been answered correctly. Manish Jha | Operations Support Engineer | vCloud Air Operations vExpert 2015-17 | vExpert-NSX | vExpert-Cloud | VCAP6-DCV | VCP6-DCV | RHCE-7 Website : http://vstellar.com
Reply
0 Kudos