Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Get all virtual disk from a VM in workflow

$
0
0

Hi,

because on VRA/VRO 7.0.1 reconfigure VM does not have the lifecycle event broker, i need to retrive some information about VM to synchronize the new state on the database.

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

i need something like this:

Server-1

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

'Hard Disk 2' 'SCSI (0:1)'

'Hard Disk 3' 'SCSI (0:2)'

Server-2

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

'Hard Disk 2' 'SCSI (0:1)'

[...]


Now i use this simple test script in VRO Javascript Workflow:


var vms = VcPlugin.getAllVirtualMachines();

for(i in vms){

    var vm = vms[i];

    vmInfo(vm);

var devices = vm.config.hardware.device;

if ( devices != null )  {

    for ( device in devices )  {

var label_name = devices[device].deviceInfo.label

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

var summary_name = devices[device].deviceInfo.summaryl

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

        if ( devices[device] instanceof VcVirtualBusLogicController || devices[device] instanceof VcVirtualLsiLogicController

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

scsiControllerKey = devices[device].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] label name:Video card

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

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

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

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

[2016-06-06 16:25:48.718] [I] summary name: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?

Thanks so much

Sergio


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>