twoton
Enthusiast
Enthusiast

Using vRO (without vRA) to Manage VM Lease Times

Hello-

I'm trying to come up with a way to use vRO to manage VMs using lease times.  I do not have vRA so this is a fairly difficult topic to search for as google seems to give me a lot of results for vRA applications.  

My basic overview would look like this:

-Workflow to set a VM lease time/expire date: Run manually at first, with the ability to get all machines in a Resource pool and set them to some initial date and also the ability to run it on a single specific VM

-Workflow that will run each day at a scheduled time, that will loop through all VMs in a resource pool, check their lease time/expire date, send an email warning to users as the date gets closer, power down/archive VMs that have hit their expiration date, and possibly maybe delete VMs that are X number of days past their expire date, though I may just do that manually for extra safety.  

I'm assuming this is possible in vRO but not entirely sure where to start.  I'm thinking that the lease times/dates could be set in a VM custom attribute (unless there is a better built in property to use?), but I'm kind of stumbling on how exactly to write this in the workflow.  I'm pretty new to vRO, but I've done a lot of fancy stuff in PowerCLI before so thought it would be similar.  Instead, looks like I need to write these scripts in javascript?  In fact, I think I probably could write something in PowerCLI to perform these tasks that would run from a Windows host using the Windows task scheduler, but I feel like vRO is the right tool for the job.  Maybe its an unnecessary complication though?  Thoughts? 

If anyone knows of some good resources/guides/how tos for getting started with something like this, I would be highly appreciative.  I've found some basic guides on vRO but nothing that really gives me any insight on how to accomplish what I am trying to do.  

0 Kudos
3 Replies
qc4vmware
Virtuoso
Virtuoso

Most of what you are suggesting can be accomplished without the need for customization.  You can bake most of it into your blueprint definition including a period to keep the vm and not delete it.  It'll just be powered off.  You can set things that can allow for users to extend their lease etc.

All of my knowledge goes up to version 7.6 of vRA/vRO and I'm not sure everything works the same in 8.0 and above.  If you are in that version then you'll need to do some additional research.  One very weak piece that needs enhancing in the 7.x world is the messaging.  We did have to do some customization to notify to meet our needs.  In 8.x you can write your vRO code snippets in powershell if that is your comfort zone.  I forget all of the languages they now support but you have choices beyond javascript.

I think how you architect it all is really up to you.  There are too many choices to help with that but I really love using vRO.  I consider vRA/vRO one product.  We've managed all extensibility with vRO and also use the policy engine to run any scheduled tasks.  It is gonna take some dedication to come up to speed with vRO but its totally worth the time spent.

0 Kudos
twoton
Enthusiast
Enthusiast

Is a blueprint something that's in vRO?  I thought that was a vRA thing.  Or did you just mean workflow? 

I'm definitely not a java script person... not that I couldn't learn it but if I can write stuff in Powershell that would be one less new thing to learn.  I did try deploying vRO 8.2 but it would never start the web console, and then I deployed 8.1 and had other problems, but figured out what I was doing wrong when I tried deploying 7.6  If re-deploying with 8.1 would give me the ability to write in powershell, I'll definitely revisit that.  

So let me ask a basic question... is most of the work in a vRO workflow done through the custom script items?  There is a lot of stuff in the visual schema page but it seems like the only real tasks for doing the meat of the work are either creating custom scripts or re-using existing workflows, which in my case there aren't any for what I'm trying to do.  I guess right now I'm having some problems getting off the ground and getting a better understanding of what exactly I need to do in order to make my general overview a reality.  The guides I have found so far are either extremely basic and just use built in workflows, or they reference a lot of stuff that seems to assume you are also running vRA and not a stand alone instance of vRO.  

0 Kudos
qc4vmware
Virtuoso
Virtuoso

My apologies I misunderstood your initial question.

 

You definitely have other language options with 8.x I think they may have added some additional options in 8.2.

 

What I've found with vRO is most of the plugins merely expose the underlying api but don't really do a whole lot for you.  Like you said they'll have some examples but not a ton of really useful stuff for specific tasks to get done.  You'll be doing a good amount of scripting to glue things together and you'll need to come up with a method for tracking the leases either back tagging things, keeping a database, etc.  There used to be pretty good book for vRO a while back but not sure if there is an 8.x update or not.  There is also a pretty decent youtube channel https://www.youtube.com/channel/UCIGb456BHqb38R-14hgfGoQ that might help kick start you.

 

Some of the individual plugin documentation has some pretty good examples.  For something like vCenter being familiar with the api's helps a lot with using the plugin.

0 Kudos