VMware {code} Community
sivadevel
Enthusiast
Enthusiast
Jump to solution

How to get the value of DeviceKet in QueryChangedDiskAreas function?

Hi,

I am trying to get the changed block value for a VM from a ESXi server. I have the object reference for Snapshot and the VM to be passed for the function QueryChangedDiskAreas. How can I get the 3rd parameter deviceKey - which I understand is the disk that I have to get the Changed block for. Can someone tell how can I get this value?

Thanks,

./Siva

0 Kudos
1 Solution

Accepted Solutions
togtog
Hot Shot
Hot Shot
Jump to solution

Hi Siva!

I would suggest using data object property VM.config.hardware.device[].key. For sure you will have to scan the array first and find the virtual disk in question. As far as I can tell the deviceKey is actually the array index. But I would not rely on this. So better use the concrete property's value.

Hope this helps

Thomas G.

View solution in original post

0 Kudos
2 Replies
togtog
Hot Shot
Hot Shot
Jump to solution

Hi Siva!

I would suggest using data object property VM.config.hardware.device[].key. For sure you will have to scan the array first and find the virtual disk in question. As far as I can tell the deviceKey is actually the array index. But I would not rely on this. So better use the concrete property's value.

Hope this helps

Thomas G.
0 Kudos
sivadevel
Enthusiast
Enthusiast
Jump to solution

Thomas,

That was perfect. The deviceKey value for Harddisk 1 came as 2000, I saw the value in another post where deviceKey was hardcoded as 2000. May it is fixed for Harddisk 1 and increases for each of the harddisks added. I will filter out Harddisk string out of that list and backup each file. Will try that.

Thanks,

./Siva.

0 Kudos