Highlighted
Hot Shot
Hot Shot

[vRA 7.6] Creating virtual SCSI controllers and virtual disks, and specifying SPBM for CloneWorkflow blueprints

I have a need to add virtual SCSI controllers and virtual disks to those controllers at time of deployment for CloneWorkflow based blueprints and being able to specify the SPBM (Storage Policy Based Management) to those virtual disks.

While doing my research I noticed that some of our blueprints where virtual disks were added would have "machine.properties" properties like so:

      VirtualMachine.Disk0.DeviceID : SCSI (0:0)

      VirtualMachine.Disk0.ExternalID : <id>

      VirtualMachine.Disk0.IsClone : true

      VirtualMachine.Disk0.IsFixed : False

      VirtualMachine.Disk0.Label : Hard disk 1

      VirtualMachine.Disk0.Name : Hard disk 1

      VirtualMachine.Disk0.Size : 100

      VirtualMachine.Disk0.Storage : <storage name>

      VirtualMachine.Disk0.Storage.Cluster.ExternalReferenceId : <storage id>

      VirtualMachine.Disk0.Storage.Cluster.Name : <name of storage>

      VirtualMachine.Disk1.DeviceID : SCSI (0:1)

      VirtualMachine.Disk1.ExternalID : <id>

      VirtualMachine.Disk1.IsClone : false

      VirtualMachine.Disk1.IsFixed : False

      VirtualMachine.Disk1.Label : Hard disk 2

      VirtualMachine.Disk1.Letter : /dev/sdb

      VirtualMachine.Disk1.Name : Hard disk 2

      VirtualMachine.Disk1.Size : 2

      VirtualMachine.Disk1.Storage : <storage name>

      VirtualMachine.Disk1.Storage.Cluster.ExternalReferenceId : <storage id>

The blueprint editor does not allow you to specify the virtual SCSI controller, hence all additional virtual disks are bound the the first/default controller in the template.

(1) Is it possible to change the value of "VirtualMachine.DiskN.DeviceID" to specify a virtual SCSI controller other than zero, e.g. (1:0), and have that controller created automatically? Obviously there would need to be additional properties to specify the type of controller, etc.

(2) If yes then what was the approach? Was it a matter of adding the properties to the blueprint? Part of the reason for asking is that the documentation on this family of properties (Custom Properties V​) doesn't mention "VirtualMachine.DiskN.DeviceID". Is there another source of information for "VirtualMachine.DiskN.DeviceID"?

(3) Is there an easy/more direct way of specifying the vSphere SPBM policy or is custom coding the only solution? The "VirtualMachine.DiskN.Storage*" properties (Custom Properties V​) refer to vRA storage reservation policies not vSphere SPBM.

(4) Also, the documentation doesn't explain "VirtualMachine.DiskN.Size" other than as a reference for the explanation of "VirtualMachine.Admin.TotalDiskUsage". Any other sources of information for this property?

Thanks in advance.

0 Kudos
5 Replies
Highlighted
Hot Shot
Hot Shot

(1) On 99% the controller is not created automatically. I have never tested  what happened if you had the controller created in template.

I will follow topic Smiley Happy because I am also interested in solution.

0 Kudos
Highlighted
Enthusiast
Enthusiast

Hi,

I have done some testing, but can't get the DeviceId property to work. If used these steps:

I find the reconfigure resourceActionId by this request:

https://{{vra}}/catalog-service/api/consumer/resources/{{resourceId}}/actions

Then I get the reconfigureActionTemplate by this request:

https://{{vra}}/catalog-service/api/consumer/resources/{resourceId}/actions/{resourceActionId}/requests/template

From the reconfigureActionTemplate I copy one of the existing disks and change the properties:

- Name

- DeviceID

and delete:

externalId

Then the JSON object looks like this:

newDisk = {

"componentTypeId": "com.vmware.csp.component.iaas.proxy.provider",

"componentId": null,

"classId": "Infrastructure.Compute.Machine.MachineDisk",

"typeFilter": null,

"data": {

"customProperties": [

{

"componentTypeId": "com.vmware.csp.component.iaas.proxy.provider",

"componentId": null,

"classId": "Infrastructure.CustomProperty",

"typeFilter": null,

"data": {

"id": "IsClone",

"is_encrypted": false,

"is_hidden": false,

"prompt_user": false,

"value": "false"

}

},

{

"componentTypeId": "com.vmware.csp.component.iaas.proxy.provider",

"componentId": null,

"classId": "Infrastructure.CustomProperty",

"typeFilter": null,

"data": {

"id": "DeviceID",

"is_encrypted": false,

"is_hidden": false,

"prompt_user": false,

"value": "SCSI (1:15)"

}

},

{

"componentTypeId": "com.vmware.csp.component.iaas.proxy.provider",

"componentId": null,

"classId": "Infrastructure.CustomProperty",

"typeFilter": null,

"data": {

"id": "Storage.Cluster.ExternalReferenceId",

"is_encrypted": false,

"is_hidden": false,

"prompt_user": false,

"value": "group-p624"

}

},

{

"componentTypeId": "com.vmware.csp.component.iaas.proxy.provider",

"componentId": null,

"classId": "Infrastructure.CustomProperty",

"typeFilter": null,

"data": {

"id": "Storage.Cluster.Name",

"is_encrypted": false,

"is_hidden": false,

"prompt_user": false,

"value": "StorageCluster_VHH05W01N_SVC_STANDARD"

}

},

{

"componentTypeId": "com.vmware.csp.component.iaas.proxy.provider",

"componentId": null,

"classId": "Infrastructure.CustomProperty",

"typeFilter": null,

"data": {

"id": "Name",

"is_encrypted": false,

"is_hidden": false,

"prompt_user": false,

"value": "Hard disk 2"

}

}

],

"driveLetter": null,

"label": null,

"reservationPolicy": null,

"reservationPolicyMode": null,

"size": 15,

"storagePath": "StorageCluster_VHH05W01N_SVC_STANDARD"

}

}

Then I add the new disk to the reconfigureActionTemplate object:

reconfigureActionTemplate.data.disks.push(newDisk));

Invoke reconfigure task:

https://{{vra}}/catalog-service/api/consumer/resources/{resourceId}/actions/{resourceActionId}/requests

This works, the additional disk is created with all the expected values, except the DeviceId setting. The DevicesId is ignored both when I change scsi device id and scsi controller id.

Even when the scsi controller is present before doing this request.

Is the DeviceId not valid costum property?

Is the syntax wrong?

Is there another way to do this i vRA? (I can it in vCenter, but that is not a valid option)

I hope somebody can help.

/Brian

0 Kudos
Highlighted
Enthusiast
Enthusiast

Hi,

Is DeviceID a valid custom property when adding an additional disk to a VM? I wish to use DeviceID to specify the SCSI Controller the disk should be created on.

example:

VirtualMachine.Disk1.DeviceID : SCSI (1:1)

When I use DeviceID it is ignored. Is it by design?

/Brian

0 Kudos
Highlighted
Enthusiast
Enthusiast

++bumping this; same requirement here

0 Kudos
Highlighted
Contributor
Contributor

Do we need to create controllers? DeviceID mapping while creating drives is not working!
Please provide the details, if anyone found the solution!

0 Kudos