Hi there,
I'm looking to automate expanding a disk trough the API, mostly for Ubuntu servers.
For this, I have to identify which disk to expand by mapping sdb to the right disk by comparing SCSI ID's
On Ubuntu, I can fetch the SCSI id trough the command ls -d /sys/block/sd*/device/scsi_device/* |awk -F '[/]' '{print $4,"- SCSI",$7}'
which results in (for example)
sda - SCSI 2:0:0:0
sdb - SCSI 2:0:1:0
sdc - SCSI 2:0:2:0
But for the life of me, I cannot seem to get the SCSI ID from the VRA API.
However, I do see it on the UI (machine-id)
using the endpoint {{vraurl}}/catalog-service/api/consumer/resources/740d901a-c796-40d8-bc7c-9ef9eff4dbc7 doesn't show it.
Can anyone give me a few tips how to fetch this data?
thanks a lot
regards
Bart
If you can get the Custom Properties of the VM you should find the SCSI ID under
VirtualMachine.Disk<N>.DeviceID
How would I go about getting the custom properties of a vm trough the API?
When i use the endpoint {{vraurl}}/catalog-service/api/consumer/resources/740d901a-c796-40d8-bc7c-9ef9eff4dbc7
I do get custom properties, but it doesn't contain the VirtualMachine.Disk
HI,
Get-VM | Get-HardDisk |
Select @{N='VM';E={$_.Parent.Name}},Name,@{N='SCSIid';E={$_.ExtensionData.UnitNumber}}
VMware PowerCLI Forum - VMware {code}
Best Regards,
Alessandro ROmeo
Hmmm - the property I referenced is an IaaS level property which the API seems to either not expose or just ignores....
I took a look and even tried this
consumer/resources/<resource-id>?withExtendedData=true
but you sitll don't get the low-level IaaS properties for the disks etc
The only other option I can think of would be to use the vRA API to get the Resource details and then use the another API / mechanism to get the the VM hardware data
- PowerCLI calls as AlessandroRomeo68 suggested
- VM external ID with the vCenter API to get the VM hardware info
- vRO Workflow call via API to access the IaaS sub-system and get the SCSI ID
Thanks for your responses guys!
I'm gonna try and fetch it trough powershell.
Another option i'm considering is using the VMware api and expanding the disk from there, instead of VRA. (but less desirable)