VMware Cloud Community
bdamian
Expert
Expert

Create a VM specifying a different storageProfile

Hi Team,

I'm using vCloud plugin 5.1 and I can't found a way to create a VM (from a template) specifying a storage profile (different than default).

The only I found is to change the storage profile of a VM so, I need to create the VM and then change the storage profle. But this methos fails if I don't have enougth space in the Default storage profile.

I modify the action called "addVAppTemplateVM" and add a new line (in bold) line:

var recomposeVAppParams = new VclRecomposeVAppParams();

var vmItem = new VclSourcedCompositionItemParam();
if (vmName != null) vmTemplate.name = vmName;
vmItem.source = vmTemplate.getReference();
vmItem.sourceDelete = false;
if (vmStorageProfile != null) vmItem.storageProfile = vmStorageProfile.getReference();
vmItem.instantiationParams = new VclInstantiationParams();

But sometimes work and sometimes doesn't work without any error.

¿Any ideas?

Thanks a lot.

---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
0 Kudos
1 Reply
bdamian
Expert
Expert

Just to say that the example worked just fine after all. Just like i've posted.

---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
0 Kudos