Get all the virtual disk to a virtual machine in the workflow

Hello

because on the VRO/VRA 7.0.1 reconfigure VM doesn't have the broker of life cycle events, I need to retrieve information about the virtual machine to synchronize the new State in the database.

I can't find the method to get the name of the disk and their id SCSI virtual

I need something like this:

Server-1

"Hard Disk 1' ' SCSI (0:0).

«Disk 2 "hard" SCSI (0:1) "»

«Disc 3 "hard" SCSI (0:2) "»

Server-2

"Hard Disk 1' ' SCSI (0:0).

«Disk 2 "hard" SCSI (0:1) "»

[...]


Now, I use this simple test script VRO Javascript Workflow:


machines virtual var = VcPlugin.getAllVirtualMachines ();

for {(i SMV)

var vm = vms [i];

vmInfo (vm);

var features = vm.config.hardware.device;

If (features! = null) {}

for (device in devices) {}

var label_name =. deviceInfo.label devices [device]

System.log ("name:" + label_name);

var summary_name = [peripheral] deviceInfo.summaryl of devices.

System.log ("summary name:" + summary_name);

If ([peripheral] devices instanceof VcVirtualBusLogicController | instanceof devices [device] VcVirtualLsiLogicController)

|| device [device] instanceof VcParaVirtualSCSIController | instanceof VcVirtualLsiLogicSASController devices [device]) {}

scsiControllerKey = devices [peripheral] .key;

bus devices = [device];

busNumber devices [device] = .busNumber;

System.log ("SCSI controller found. (Key: "+ scsiControllerKey +" ' ") ») ;

System.log ("Bus number:" + busNumber);

break;

}

}

}

but print an output like this:

[...]

2016-06-06 16:25:48.707] [I] the name tag: Video card

[2016-06-06 16:25:48.709] [I] name summary: undefined

[2016-06-06 16:25:48.711] [I] label name: VMCI device

[2016-06-06 16:25:48.714] [I] name summary: undefined

[2016-06-06 16:25:48.716] [I] label name controller: SCSI 0

[2016-06-06 16:25:48.718] [I] name summary: undefined

[2016-06-06 16:25:48.720] [I] SCSI controller found. (Key: 1000)

[2016-06-06 16:25:48.722] [I] Bus number: 0

[...]

can someone help me?

Thank you very much

Sergio

Hi Sergio,

Here is an example of code (the input parameter is type virtual machine vm ):

var devices = vm.config.hardware.device;
for each (controller in devices) {
  var is_scsi = controller instanceof VcVirtualBusLogicController || controller instanceof VcVirtualLsiLogicController
       || controller instanceof VcParaVirtualSCSIController || controller instanceof VcVirtualLsiLogicSASController;
  if (!is_scsi) {
    continue;
  }
  var controller_label = controller.deviceInfo.label;
  System.log("SCSI controller found: " + controller_label);
  for each (device in devices) {
    if (device.controllerKey == controller.key) {
      var scsi_id = controller.busNumber + ":" + device.unitNumber;
      System.log("    device found:  '" + device.deviceInfo.label + "'  'SCSI (" + scsi_id + ")'");
    }
  }
}

SCSI ID is a combination of the number of buses of the controller and unit of the device number.

Tags: VMware

Similar Questions

Maybe you are looking for

  • G20-120: the drive cannot recognize burned discs

    Hello world!After a self-inflicted mistake I ve had to recover the system with the Toshiba Recovery CD.Then the CD-ROM drive no longer recognise my music burned or other CD except manufacturers including XP Pro installation CD. I get all sorts of err

  • advice of dongle required please

    Hello computer kind people. I'm a non-geek, but reasonably intelligent Lady retired and I just bought a new office to replace my ancient machine.  My new pc is a Compaq Presario CQ5034UK (NQ882AA).  Operating system is Windows Vista Home Premium.  It

  • blur - up for Windows xp Office

    Hello;Wish you all Happy New Year! I hope someone could help me solve this problem.I have an old laptop of 510 m Dell Inspiron that has windows xp sp2 on it. Some time ago I thought that I would like to clean the laptop to speed it up. I cleaned ever

  • Why my Dell laptop freezes so often?

    My laptop crashes maybe every 20 or 30 seconds for about 10 to 15 seconds. It does not matter what I do if I am on the internet or if I use some software.  I checked for malware and viruses.  I tried patches from microsoft.  I have 60 gigs of space o

  • Request BIOS password

    What is my Bios password? It says key 91059266