CalmCloud
Enthusiast
Enthusiast

Update VRA Storage Reservation Size

Jump to solution

Hi All,

After adding datastore to a cluster need to increase storage reservation  in VRA as shown below. My requirement is increase VRA Storage Reservation through a workflow.

Reservation.png

I tried the following

var entity = System.getModule("com.vmware.library.vcac").getReservationEntityByName(vcacHost,reservationName) ;

attrNewProperties = new Properties();

attrNewProperties["ReservationStorageSizeGB"] = "778"

System.getModule("com.vmware.library.vcac").updateEntity(entity,attrNewProperties ,links) ;

The workflow executes without error but no updates are seen on the VRA portal.

Interestingly VRO shows updated property.

vroReservation.png

Any idea how to update Reservation in VRA?

Thanks

1 Solution

Accepted Solutions
CalmCloud
Enthusiast
Enthusiast

I was able to get it working.

hostReservationEntity = System.getModule("com.vmware.library.vcac").getReservationEntityByName(iaasHost,computeClusterReservation) ;

var reservStorages = hostReservationEntity.getLink(iaasHost, "HostReservationToStorages");

var storage = reservStorages[0].getLink(iaasHost, "HostToStorage")[0];

  var hostReservationToStoragesEntities =  storage.getLink(iaasHost,"HostReservationToStorages");

  var HostReservationToStoragesEntity = hostReservationToStoragesEntities[0];

  var currentCapacity = HostReservationToStoragesEntity.getProperties()["MaxCapacity"];

  System.log("currentCapacity:"+currentCapacity);

  var newCapacity = currentCapacity + 1000;

  var attrNewProperties = new Properties();

  attrNewProperties["MaxCapacity"] = newCapcity;

  System.log("newCapcity:"+newCapcity);

  System.getModule("com.vmware.library.vcac").updateEntity(HostReservationToStoragesEntity,attrNewProperties ,null) ;

View solution in original post

5 Replies
Pratician
Enthusiast
Enthusiast

Hi,

I have just made a quick workflow to update a storage reservation, attached to the post. It does work thru the vCACCAFE library.

It is still way upgradable and may need more flexibility, but it does work.

It uses reservation name, storage path label as well as new reservation size in string format in input parameter.

Hope it fits your need Smiley Wink

0 Kudos
CalmCloud
Enthusiast
Enthusiast

Sorry I missed the response.....I will test asap.

0 Kudos
CalmCloud
Enthusiast
Enthusiast

there is no createReservationClient method on VCACCafeHost....I am on VRO 6.0.3, VCAC Plugin 6.2 and VRA 6.2.0

0 Kudos
CalmCloud
Enthusiast
Enthusiast

I was able to get it working.

hostReservationEntity = System.getModule("com.vmware.library.vcac").getReservationEntityByName(iaasHost,computeClusterReservation) ;

var reservStorages = hostReservationEntity.getLink(iaasHost, "HostReservationToStorages");

var storage = reservStorages[0].getLink(iaasHost, "HostToStorage")[0];

  var hostReservationToStoragesEntities =  storage.getLink(iaasHost,"HostReservationToStorages");

  var HostReservationToStoragesEntity = hostReservationToStoragesEntities[0];

  var currentCapacity = HostReservationToStoragesEntity.getProperties()["MaxCapacity"];

  System.log("currentCapacity:"+currentCapacity);

  var newCapacity = currentCapacity + 1000;

  var attrNewProperties = new Properties();

  attrNewProperties["MaxCapacity"] = newCapcity;

  System.log("newCapcity:"+newCapcity);

  System.getModule("com.vmware.library.vcac").updateEntity(HostReservationToStoragesEntity,attrNewProperties ,null) ;

View solution in original post

Suri009
Contributor
Contributor

Hi

Can you send me your workflow please, as I am unable to update reservation size.

Thanks

0 Kudos