Category Archives: Orchestrator

VM Auto-Provisioning With SCVMM and Orchestrator

This post is mostly background and a very high-level overview of process.  I will try to post the related code and runbooks with a future entry.

We recently decided to start reworking our VM request forms.  Previously, these were actual paper forms with a lot of unneeded information on them.

I got to thinking about it and after a discussion with one of my co-workers, I started working on a quick-and-dirty web page system done in ASP.NET and C#.  I’m not really a web developer so it probably doesn’t look too great but it works enough to get VM information and write the info to a database.

Once I had the page up and running, I started to wonder – could we take this one step further?  Why not link this database up with Orchestrator so the VMs provision themselves?

So, I started writing some runbooks to handle provisioning of machines that the user specified should be in SCVMM.  I soon realized that Orchestrator is kind of limited when it comes to provisioning VMs if there is no cloud created in SCVMM.

The next step was to create a private cloud in SCVMM.  You can follow the previous link for instructions on how to do that – it’s pretty straightforward.

I got the private cloud up and running, then turned back to the runbooks.  Orchestrator is also limited in what kind of data it can return from a database.  It will only give you semicolon-delimited strings which need to be parsed with PowerShell in order to get the values needed to build the VM.

Once you get the data out, you can use the SCVMM Integration Pack to start building the VMs.  There’s a few gotchas in this process that I will discuss in more detail in future posts.

Two days later the runbooks were complete and the VMs provision themselves automagically when the user clicks the “Add VM” button on the webpage.

As I stated at the beginning of this post, I’d like to add the web page code and the runbooks to my GitHub, but I don’t have them at home right now as I just finished the project and got home from work.

Stay tuned for more information!

PS: I am off to try my hand on the 70-410 exam tomorrow as my first step to MCSE certification.  Wish me luck!  I hope I can pass.

System Center Orchestrator And VM Creation Rant

I’ve recently got the chance to begin working with System Center Orchestrator 2012 R2, which is looking like it is going to be awesome for really getting our environment to the automated level.  That is, if I ever figure out how to use the thing.

I have been looking through the book System Center 2012 Orchestrator Unleashed on Safari Books which has given me a decent basic introduction to functionality and features, but there’s a lot that can be done with this product, especially when you start adding Integration Packs to interface with other System Center products and anything else in your environment with a provided IP.

Right now, I am trying to automate the VM creation process through Orchestrator.  The goal is to make the creation of one or many VMs a single-click operation from a webpage.  This has been much more of a challenge than I anticipated.

When you aren’t using PowerShell or a scripting editor such as PowerCLI, it is hard to keep track of all the operations that need to happen before the next step can take place.  For example, the next step in your procedure might require a VM ID instead of a VM Name, which might not be published data from the activity that just finished.  So you get lost trying to figure out why the operation just failed, when you are passing information the next step can’t use.

I’ve taken to saving the VM specifications in a database and using Orchestrator to query the information.  Sadly, Orchestrator cannot return information from a database query except as a semicolon-delimited string, which means you need a script to parse that output and then build arrays for your activities.

Looping is another complaint I have.  It doesn’t seem as flexible as what is available in PowerShell.  I was attempting to allow a runbook to create multiple hard disks, but it took a long time for me to figure out how to get the loop to pick out a different bus for each disk.  Actually, that one was kind of embarrassing because you can count the number of times a loop has executed, but it’s not obvious.

Maybe I should just be chalking all this up to the learning phase, but it seems like there is a real lack of documentation for Orchestrator itself.  Don’t get me wrong though, I think it is going to be a great thing once we get some runbooks built and working the way we want.

I hope to have some runbooks that I’ll be able to post to GitHub once I get something of use done, so maybe someone can learn from my mistakes.