Last week I spent some time working on using vRO to populate a new Disk with a SCSI adapter.
The request came in as any other typically does with a simple, hey is there any easy way to do this? I dug through what I thought would be a quick and simple set of workflows… Only to find out there isn’t a OOTB workflow to utilize and even worse if I try to add a disk to a new adapter the vRO workflow will fail because the SCSI adapter doesn’t exist. There also would be the vulnerability of losing the data, if not backed up with a standalone USB duplicator.
To me this was a bit perplexing considering the fact that when you walk through a vCenter add disk it prompts you which SCSI adapter and will create one if you choose one that doesn’t exist.
Needless to say this motivated me to jump in and automate it! There are a few other examples that Dan and Christophe have worked on out in the communities and forums, but when I wanted to automate them I found it to be a bit of challenge. So here we are the workflow and automated action to do this with vRA as a new action item.
This post will actually be broken down into 2 sections
- Deploy disk onto the next SCSI adapter using a resource action (i.e. day 2 operation)
- Deploy a disk onto the next SCSI adapter at provision time with a cool little slider for the consumer
Here’s the video walk through to match this post
and a link to the vRO package.
I’m assuming if you’re following along with my blog you have already downloaded the vRO package and imported it. In this first step we’ll look at the workflow that is “Create SCSI and Add Hard Disk”. As you can see it’s pretty simple four steps
- We pull in the selected VM properties and figure out what Datastore it’s on
- We create the reconfigure task to calculate what SCSI adapters exist and what the next possible one is
- We run the reconfigure task with the parameters from the scriptable task
- Add a hard disk to the VM
Running the workflow will prompt you for the following settings.
Watching the variables you will see the Datastore is found and passed for the selected VM object.
If you review the logs of the running task you’ll see the SCSI controllers found and what the next one should be.
Then check vCenter and you’ll see the task of reconfigure will have completed successfully.
Here is an example of the VM that we just ran the workflow against. As you can see we deployed it using vRA and please notice the list of entitled actions.
Now let’s go create the actual action item that will call the workflow we used earlier.
Go to Design -> Resource Actions -> New
Expand the tree and select the Create SCSI and Add Hard Disk.
The next step will just illustrate that you have a VM object in the workflow and it will automatically map to the VM in your vRA portal.
Next we are presented with the Form Title and options. This is something that give you power to be selective about what you show and what conditions might need to be set in order for this to be displayed to the consumer. In this case we want it to hide the intro, and to be available for any VM object.
Now we edit the form name. If you used the default it would give you Step as the form, instead I want to change to “Add a new disk and SCSI”.
Then we’ll edit each of the options in the workflow. First the Disk size which we will set to a default value of 1 (if nothing is set it will fail).
Then we move to the Constraints tab, where we make sure
Required = Yes
Visible = Yes
Make sure to click apply after changing these settings!
Moving on to Disk persistence mode and the Constraints tab
Required = Yes
Read only = Yes
Value = (your choice) I always use Persistent
Visible = No ( we want to hide this as the consumer won’t be able to change it from our settings)
Make sure to click apply after changing these settings!
Moving on to Use thin provisioning and the Constraints tab
Visible = Yes
Make sure to click apply after changing these settings!
Finally we’ll set the Adapter type and the Constraints tab
Required = Yes
Read only = Yes
Value = (your choice) I always use PARA but you can choose LSI, SAS, or BUS
Visible = No ( we want to hide this as the consumer won’t be able to change it from our settings)
Make sure to click apply after changing these settings!
Then click to finish which will bring you back out to the Resource Actions page. Here you select and Publish, don’t forget this part!!
Now let’s entitle the action to our consumers.
Go to Administration -> Entitlements -> Choose your entitlement (mine is Cloud Admins)
Go to the Items & Approvals tab
Search for “create” in the Entitled actions and select the newly published offering.
Now we go back to our provisioned item and look at the action list and you’ll see the option for our Add disk and SCSI.
If you execute it you’ll see the following form and it will run the vRO workflow.
And just to illustrate the request has been submitted, go to your Requests tab.
You can jump back into Orchestrator and view the running workflow.
Or just check vCenter as the reconfigure task gets executed.
After completing this you should now be able to:
- A vRO workflow that will enable to you provision a new hard disk to an existing virtual machine
- A action that enables the users to request this through vRA to an existing provisioned virtual machine
Some of the power not illustrated here is that you can choose to entitle per specific conditions or even require an approval policy so people don’t abuse this action. Next time we will build out the method to use do this same thing at provision time instead of as a day two action! Stay tuned!!!
11 comments
1 ping
Skip to comment form
Good morning from Italy.
I’m trying to import the package into our 7.0.1 Orchestrator, but the operation seems to partially fail (for components that should reside under com.vmware.library.vc… ) showing this https://snag.gy/xqmtYZ.jpg
I’m sorry for my lack of proper terminology, but I’m just starting my journey in Automation/Orchestrator.
Best regards and thanks in advance
Let me test in my 7.0.1 instance and see if I can resolve for you! Stay tuned
Hi Gary,
Great post. I was wondering if was a way to add a hard disk to an existing virtual machine and select a storage reservation policy when doing the request. We don’t store our secondary disk with the OS disk in our platform, and also some datastores are replicated and other aren’t, there is a storage reservation policy applied to each option.
I’d like a user to be able to request a new VM and select the required policy. Just struggling to figure out how to expose the available policies.
Any help greatly appreciated. Big fan of your site.
Regards
Dean
Dean,
You may want to check in 7.2, I haven’t had any chance to look at it but as of 7.1 and before there’s no real way to access the storage reservation policy because of it not being an exposed API. I think you might be able to do it in the same manner I did the custom request https://extendingclouds.com/vrealize-automation-7-custom-request-form-using-xaas/ basically altering the request but checking and altering the json string but it’s not a great method to accomplish what you’re looking for.
Gary as always thanks for the reply, I appreciate you going out of your way to help us out. We did manage to get this working, but its definitely an inefficient way to do it.
Have a great day.
Hi Team,
Getting below error on action. any clue.
Failed to convert external resource VM Name. Script action com.vmware.vcac.asd.mappings/mapToVCVM failed.
Thanks
Parag
What versions of VRA and VCenter are you running? The error is basically saying that it can’t map the vCAC VM to a vCenter VM object.
Hi How to give drive letter and Disk Lable
Author
I never figured out how to over ride the drive label
After deploying this solution we faced one issuetthat if we are adding more than 3 disk its give error “NO CONTROLLER FOUND”
kindly edit the workflow to add a disk in same scsi controller if that is exceed then only it should go for other controller
Author
Sorry I don’t have access to the software any longer to update these samples. You should be able to do a scsi lookup tho and automatically select a new one for more disks.
[…] « New Disk with a SCSI adapter […]