As many of you may know one of the features that was available in vCD was the ability to have a unique password when the consumers requested the vApps. Obviously this was great for security but wasn’t always loved by the users. Enter vCAC which gives you some more flexibility and can be augmented so that during the request process you can provide the users access to create their own passwords.
This post is a bit long as there are many steps but it’s something simple that can be repeatable for really anything that you may want to take from user input and make a decision. Also if you don’t want to create the vCO workflow from scratch here is my vCO workflow that you can import directly in and edit as you see fit.
Start in the vCAC web console as an Infrastructure Admin
Go to -> Infrastructure tab -> Blueprints
Go to -> Property Dictionary
New Property Definition
- Name – make sure to choose a name that is very unique. You will use this in multiple steps including the vCO workflow
- Display Name – this is what the users will see on their request page
- Description – optional
- Control Type – Password
- Check Required
Now we are going to create rules around what the password should be, there’s no way we want our users selecting the passkey that’s on their luggage 12345 !
Click on the edit link under Property Attributes
New Property Attribute
- Select the RegEx, this is the regular expression that will force the users to meet specific password requirements
- Name – enter the name you wish to use for the password regex
- Value – I have used the following, in this example it requires 1 special character, 1 upper case, 1 lowercase, and is between 8-16 characters long
^(?=.*d)(?=.*[a-z])(?=.*[A-Z]).{8,16}$
This is how it should look once complete
Copy the name you created for the property definition
Go to -> Build Profiles
New Build Profile
- Give the new profile a name (this will be what you enable in the blueprint)
- Description – optional
- Name – add the property definition name that you copied in the previous step
- Value – set the default value (can be left blank)
- Check Prompt User
Now we will assign that to one of the blueprints
Go to -> Blueprints -> select the blueprint of choice and click edit
Go to -> Properties tab of that blueprint and check the build profile name you just created
Create a new Custom Property and assign a value of Linux or Windows (case sensitive)
Go to -> vCenter Orchestrator and login -> Select your workflow template, if you haven’t created that yet please see this post
- Name – create a name for this workflow
- Folder – select the folder you want this workflow in
- Copy version – optional
Click on the newly created workflow and edit
Start in the general tab and add an Attribute
Name – OS (this will be the placeholder for your custom property that you defined on the blueprint)
Go to -> Schema tab
Drag Decision into the workflow after the Display Inputs
Click the pencil to edit
Go to -> Decision tab
Click on Not set(NULL)
Select the OS attribute
Set it to equals Linux
Close
Search for SSH
Drag “run ssh” into the canvas after the decision
Click setup
Set all the bindings to Value accept path and passphrase which we will skip
Click promote
Search for Program
Drag “run a program” into the canvas on the other branch of the decision
Click setup
Set programPath to Value and click on the Input value
Set this to c:windowssystem32net.exe
This should be the final view before clicking promote
Go to -> General tab
Add new attribute
Set the name to newPassword
Click on the string type and change it to SecureString
Go to -> Schema tab
Click on the pencil to edit Display inputs
Go to -> OUT tab and select the following
- OS
- hostnameOrIP
- username
- password
- cmd
- arguments
- newPassword
Go to -> Scripting tab
This is where we put the logic together that passes into either Linux or Windows decision. As you can see in the highlighted area we get the os that is passed by the custom property, then we get the password that the user entered. Based on which OS is is defined in the blueprint we then set the username, password, and specific commands that need to be run on either OS. *notice if you are using my workflow you will want to alter the lines in this script with your custom properties and default username and password. In order to set the passwords we need to use those to log onto the systems.
Now that all of this is complete you can take this workflow and assign it to the blueprints you wish to execute against on MachineProvisioned. To learn how to assign workflows go to my previous post
6 comments
Skip to comment form
Thank you for this post, it was just what I was looking for and works perfectly apart from Linux cmd. I had to do this to make it work for me:-
cmd=’echo -e “‘ + newPassword + ‘” | passwd –stdin root’;
Looks like the workflow referenced at the top of the blog links to a dead dropbox link. Any chance we could get an updated link?
Updated the link in the post, thanks for letting me know!
Hey Gary, I know this is a year old but hopefully you still ready it. Can you show how you pulled the OS variable in vCAC? I understand its a property definition but I can’t find how to make it just read Linux or Windows
Steven, if you notice in this image I’m assigning the extendingclouds.os at the actual blueprint properties. That way you have the OS definition define per each blueprint you want to execute the workflow on. https://gcoburn2010.files.wordpress.com/2014/04/12-set-custom-prop-and-add-password-build-profile.png?w=1200&h=790
Let me know if you have questions still!
Totally missed that, thanks!