Creating Multiple Virtual Machines via Powershell Script

By Ken on May 10th, 2012

So one of my main duties here at the MTC is to provision Virtual Machines for various POCs that come through. Recently, I’ve been creating upwards of 20 Virtual Machines for a single POC and have grown tired of running the wizard for a large number of VMs. I know that we have Orchestrator and I can write a runbook, but I haven’t gotten there yet. So I wrote a Powershell script, sort of a proof of concept for myself, that has turned out to work very well.

PreReq’s:
Microsoft System Center 2012 Virtual Machine Manager
Powershell and the SCVMM Powershell commandlets

Below is the script that I’m running. I’ve highlighted changes that you should make if you plan to re-use this script:

[BEGINSCRIPT]

# User input variables here – these will prompt you for information
[int]$VMcount = Read-host “Input Number of VMs”
$CloudName = Read-host “Input Cloud name”
$VMName = Read-host “Input Base Name”

$Total = 1
$cloud = Get-SCCloud -Name $CloudName

# #### To choose a different Template, change the name here $Template = Get-SCVMTemplate -VMMServer resvmm -All | where {$_.Name -eq “Windows2008R2SP1-2Proc-2GB-VLan106″}

While ($total -le $VMCount) {

 $NewVMName = “$VMName-” + $total
 $virtualMachineConfiguration = New-SCVMConfiguration -VMTemplate $template -Name $NewVMName  
 Write-Output $virtualMachineConfiguration
 New-SCVirtualMachine -Name $NewVMName -VMConfiguration $virtualMachineConfiguration -Cloud $cloud -Description “” -ReturnImmediately -DelayStartSeconds “0″
$Total++

}

That’s all it takes to create Virtual Machines with a script. It’s pretty self explanatory if you understand scripting, if not – just ask. the only stupid question is the one that doesn’t get asked.

 

Private Cloud Click Through Demos

By Ken on May 3rd, 2012

This link takes you to Microsofts Click through labs for System Center 2012 and the Private Cloud.

http://technet.microsoft.com/en-us/evalcenter/hh913012.aspx?ocid=&wt.mc_id=TEC_112_1_33

Windows Server 2003 and System Center 2012 Virtual Machine Manager

By Ken on March 30th, 2012

One of our clients is building out a lab environment for a Proof of Concept migration. He needs multiple Windows Server 2003 VMs and we do not have a template for that OS. This post is just a collection of thoughts around the process to get Windows 2003 setup as a VM Template.

Installing and configuring the server was pretty straight forward, installed from a mounted ISO and everything just worked. Once I had the basic server down I figured I’d create the template and any updating could be done when the user created the VM.

First error I run into:

Error (678)
Sysprep binary sysprep.exe does not exist for Windows version 5.2.3790 in Folder C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\Sysprep\i386\5.2.3790.0

I went back into the server, extracted the Sysprep tools from deploy.cab on the CD and placed them in the above folder. That did NOT solve the issue. So I went back in and copied the tools to C:\Sysprep. Again, this did NOT fix the problem. I decided to run Sysprep manually. I set it to shutdown when Sysprep was finished and let it run.

I ran the Create VM Template wizard again and this time my Template created – With 1 warning:

Warning (13233)
Cannot install Virtual Guest Services on Virtual Machine TESTw2k3VM. The Hyper-V Integration Services Setup exited with error code 60001.

This is a simple fix – Install Service Pack 2 for Windows Server 2003. After the service pack update, the Guest Services installed without a hitch.

So now I have a SP2 Windows Server 2003 VM Template available on our Hyper-V farm.

I must say, it was a learning experience in itself, as I have not had a lot of practice working with creating images/templates in System Center 2012.

 

My New Blog Site

By Ken on March 1st, 2012

Welcome! So I guess this should be an intro as to why I have a blog site up. So here goes.

I have been an I.T. Consultant since the end of 1998. I formed my first company (KC Computers) around that time, and focused on break-fix repair of PCs. I was also in College at the time, and did not do much to push a business. I closed KC Computers down when I took a Road Technician Position with another Computer Firm. I spent two years with that company, moving from Road Tech to head build technician where I was in charge of assembly of PCs (at one point I had about 100 PCs in various stages of build awaiting parts). While the job was easy, there were politics at play that forced me to leave the company. I tried to focus on school and collaboration on a web development business with my brother.

With the birth of my son, it was imperative that my income level increase so I took another technician position with a small firm out of Severna Park. I enjoyed working there; my responsibilities were break-fix repair on clients PCs, a little bit of sales and every now and then a road call as a consultant. It was one of those road calls that shaped the next 10 years of my career.

I was sent to Annapolis to discuss a possible “Contract” type service for a financial firm. Unfortunately, after my initial discussion with the client, my company did not have any interest of a contractual based repair service – mainly because they only had one technician in house that could handle the road calls (ME) and they didn’t want to allot my time to a specific contract. My second visit to the client landed me a seat in the CEOs office where a good amount of discussion about my position was made. The offer made was one that I could not turn down, and after a week of contemplation, I quit the small firm and became an I.T. Consultant, again working for myself. I formed Maryland I.T. which was billed out as an “Everything I.T.” type business – and I truly did everything.

In the following years I performed the duties of a Network Administrator, PC Repair Technician, Help Desk, Printer Repair Tech, I.T. Consultant, Project Manager, Network Engineer, Infrastructure expert, installation technician, trainer, web designer, SharePoint designer, SQL specialist, exchange administrator, tape backup operator and a slew of other titles.

Meanwhile, in 2009 I felt that something was missing; I was spending to much time with my face in a monitor and not much else. So I began school for a Culinary Degree. While I have not completed that degree, I learned quite a bit about baking and pastry that I have been successful in running a part time business making Cakes for clients.

In early 2011 I felt that the financial firm I was primarily supporting was beginning to require more services. I revamped their contract for the first time in 6 years and allotted more time per month for me to be on site for support. This was a double edged sword as the contract price came down to give them some relief, and I had to sever several clients to ensure I had the time to focus on them. Within 6 months unfortunately, that tide changed again as the company finally came to the realization that as they grew globally, the services of a “One man Shop” were no longer suited for their company. A Meeting to inform me that they were switching providers was met immediately with despair; however a few days of contemplation brought me to the realization that this move, while extremely detrimental to my income stream, was the best opportunity presented to me in the last ten years.

I spent the last few months of the year spending time with the kids and working small jobs here and there. A futile attempt at partnering with a Telecom vendor took several days of my time over those few months as well. As my income began to run low, and I was determining whether or not to go back to school, or take a job as a baker, a very attractive offer was vetted my way by an unlikely source. An old business partner had called to discuss a bill that we had both let slide for a couple of months. While on the phone, and the usual “How’s life’s” were exchanged, I brought to his attention that I was no longer contractually obligated, and he brought to my attention an opening within a company I have always wanted to work for.

A few phone calls later, and I had to throw together a make-shift resume to send over. The next day, I was walking the mall with my two girls, it was about 10:00am and we were waiting for a store to open. I was on Daddy Daycare duty basically. The phone rang, and when I answered I was told that an interview for me had been scheduled, and that the recruiter had forgotten to send me the message. Being that I didn’t want to miss out on the opportunity, I took the call… Being winded, with two screaming children, in a mall in the middle of the morning didn’t make for the best interview. I drew blank trying to answer a few basic questions, but I apologized and asked if they would like to talk later in the day when I was more prepared. Instead, they asked me to come in for a face to face interview. This was a bit of a shock, due to my seeming lack of intelligence during the phone interview. So the next day I drove down and sat face to face with the prospective employer.

One question that stuck in my head from the phone call before was “Where do you see yourself in five years”. I had an entire evening to think about this question and my knee jerk answer from the day before. (which by the way, I answered with Infrastructure Manager… Yeah, I have no clue why). When the question came up in the face to face interview this was my answer:

“I’ve been an ‘I.T. Consultant’ for over 10 years. I’ve done everything from fix PCs, to design enterprise networks. With the scope of I.T. encompassing so many different specialties, I can only tell you that I do not know where I will be in five years. If I am offered a position here, I will be spending a lot of time exploring my options and truly figuring out where I would like to be.”

Apparently, this was a good answer for them even though it wasn’t an answer at all. I don’t want to start a job on lies or ill-conceived expectations.

The following Monday, I began my new job as Data Center Manager at a Microsoft Technology Center. I’ve been there for almost one month and have to say it has been a great experience so far. It’s been a great change not coming home stressed out and with a headache.

So here we are – March of 2012. I am a Data Center Manager for Microsoft (While I need to put on here I am not a full-time employee, rather a subcontractor with Atos). I’m hoping to use this blog to post items of usefulness for those entering the I.T. field or what not. Basically, as I grow in my knowledge of I.T. and find solutions to problems I have, I may post the solutions from time to time. Sure the information may be duplicated throughout the web on a variety of other sites, but repetition never hurt anyone, as long as my content is my own and I’m not violating any copyright laws, I will post it.

You may also see posts about cakes that I bake for clients as well; I will do my best to separate the two. My thoughts are simple – you need to be balanced in life: Family, Work, Leisure, Family is always first, work pays for the leisure.