VMware Cloud Community
fabro
Contributor
Contributor

Change Virtual Machine reservation before creating VM in vCenter using vRO

Hi, I'm cracking my head with this scenario:

I'm creating a Blueprint for deploying a Windows VM in a vSphere environment. On this blueprint I'm setting up some custom properties (using the Property Dictionary) to pass information to vRealize Orchestrator, from there I pretend to change the reservation dinamically, using the received parameters. Although I can change the entity's HostReservation, this doesn't seem to be reflected during the VM creation.

Did some one try to use a similar way to change reservations dinamically? Thanks!

Best regards,

Fabricio.

0 Kudos
2 Replies
zebduin
Enthusiast
Enthusiast

Not real clear on the ask.

If you're referring to changing VM virtual Hardware allocations, then this is easily done using vRO.

for instance I generally configure the property dictionary with a Small | Medium | Large drop down option

I then use a case statement that is called during Building Machine, to update the CPU and Memory allocations:

vRA Drop-down:

pastedImage_0.png

There's vRO requirements that I'm not specifying, but I generally use a case statement to update the custom property values. Case statement would look something like this.  refer to Sky Cooper's blog for setting this up:  http://realize.net)

switch (vmSize)

{

case 'Small - 1 vCPU -2GB RAM':

     propertyNames.push("VirtualMachine.Memory.Size");

     propertyValues.push("2048");

     propertyNames.push("VirtualMachine.CPU.Count");

     propertyValues.push("1");

     System.log("Set VM Size to Small: 1 vCPU and 2 GB RAM");

     break;

case 'Medium - 1 vCPU -4GB RAM':

     propertyNames.push("VirtualMachine.Memory.Size");

     propertyValues.push("4096");

     propertyNames.push("VirtualMachine.CPU.Count");

     propertyValues.push("1");

     System.log("Set VM Size to Medium: 1 vCPU and 4 GB RAM");

     break;

case 'Large - 2 vCPU -4GB RAM':

     propertyNames.push("VirtualMachine.Memory.Size");

     propertyValues.push("4096");

     propertyNames.push("VirtualMachine.CPU.Count");

     propertyValues.push("2");

     System.log("Set VM Size to Large: 2 vCPU and 4 GB RAM");

     break;

0 Kudos
riverson
Enthusiast
Enthusiast

Were you ever able to figure this out?

I'm currently trying to implement a deletion workflow that moves machines to a MachineDeletions business group or reservation.

0 Kudos