VMware Cloud Community
frefal
Enthusiast
Enthusiast
Jump to solution

Query host PCI device for attached VMs

In the web client, under a host, we can see under PCI Devices if one or multiple VMs are attached to it. The field is called "VMs Using this".

I have been going thru the API explorer but unable to find a way so far to do the same with Orchestrator - to find out if a host PCI device is in use by any VM or not. Is this possible?

0 Kudos
1 Solution

Accepted Solutions
frefal
Enthusiast
Enthusiast
Jump to solution

If anyone's interested, this is the solution;

var devices = host.configManager.graphicsManager.graphicsInfo;

for each (device in devices) {

if (device.pciId.match("46")) {

System.log(device.vm);

}

}

View solution in original post

0 Kudos
1 Reply
frefal
Enthusiast
Enthusiast
Jump to solution

If anyone's interested, this is the solution;

var devices = host.configManager.graphicsManager.graphicsInfo;

for each (device in devices) {

if (device.pciId.match("46")) {

System.log(device.vm);

}

}

0 Kudos