VMware Cloud Community
fduranti
Hot Shot
Hot Shot
Jump to solution

Get storage reservation policy name assigned to a Datastore in the Compute Resource via vco

I'm using vra 7.3 with embedded vco.

I'm trying to get the storage reservation policy assigned to a Datastore in the reservation in which i'm trying to deploy vm to be able to deploy the VM in a specific datastore.

It seems I'm not able to find the association between the datastore and the policy via vco.

I have the reservation name i'm using and the storagePath (datastore name) but cannot get the data from the vra page infrastructure/compute resources/configuration

Anyone know what query/function I can use to get this information? I've tried a lot of combination but I always end up with the storagePath and not with the Storage Reservation name that I need.

pastedImage_0.png

Thanks

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
rmav01
Enthusiast
Enthusiast
Jump to solution

Getting in the weeds a little bit, you could query the IaaS MSSQL database directly for this kind of information. If you were to query the HostStorageReservationPolicy table you can capture the names, descriptions, and most importantly any IDs associated to your storage reservation policies. With that information you can join to the HostToStorageID table with the ID (HostStorageReservationPolicyID) and relate to the StoragePath field.

Hopefully this gets you started on what you're looking for. As always the typical disclaimer of take caution when querying this DB directly, especially if the query is large or takes a long time to compute rule applies. Smiley Happy

View solution in original post

Reply
0 Kudos
2 Replies
rmav01
Enthusiast
Enthusiast
Jump to solution

Getting in the weeds a little bit, you could query the IaaS MSSQL database directly for this kind of information. If you were to query the HostStorageReservationPolicy table you can capture the names, descriptions, and most importantly any IDs associated to your storage reservation policies. With that information you can join to the HostToStorageID table with the ID (HostStorageReservationPolicyID) and relate to the StoragePath field.

Hopefully this gets you started on what you're looking for. As always the typical disclaimer of take caution when querying this DB directly, especially if the query is large or takes a long time to compute rule applies. Smiley Happy

Reply
0 Kudos
fduranti
Hot Shot
Hot Shot
Jump to solution

Thanks for the suggestion...

My need was to just be able to assign a datastore I choose to the VM disks so at the end I was able to do it without Storage reservation policy but just using VirtualMachine.Storage.Name / VirtualMachine.DiskN.Storage but being able to query the DB can be a good idea in some cases.

I've now some difficulties to set ip addresses Smiley Happy

Reply
0 Kudos