Get-VM

Automating the World Around Me

December 31, 2011
by zach
0 comments

A New Year Brings New Goals

2011 was a very good year in my career and personally. I was involved in many new projects and learned many new skills. I went into 2011 managing an enterprise-class virtual environment that covered three physical locations and two continents. My previous boss then promoted me to systems engineer and things changed drastically. I was forced out of my comfort zone and immediately began leading a group of people across multiple departments as we needed to find a new file transfer solutions for my company and its numerous operating companies. We had a few bumps but prevailed came up with a very good decision on what cloud-based product to purchase. This was only the beginning. 2012 will bring the implementation of the product to 45,000+ employees/clients.

In the virtualization world, I also led a proof-of-concept for Microsoft’s Hyper-V. We liked how far Microsoft has come with these products and plan to implement a small environment in our corporate datacenters in the coming year for our development and QA servers. Our VMware infrastructure was very robust and provided very limited issues and proved its worth when our primary datacenter power was cut on accident. I also studied for my first VMware certification this year and was able to pass the VCP 5 exam.

My previous boss also pushed me to go back and further my formal education. I started in November and will finish in the fall of 2012. This is something I never thought I’d be doing even at the beginning of 2011 but I’m in it and will receive another degree, with a major in MIS.

I have many goals and initiatives for 2012. I began tinkering with vCenter Orchestrator and realized its capabilities. I plan to use this and other resources to provide a self-servicing portal for our internal clients when they need a new server built. It will remove many steps in the process and provide a great automation tool for our operations team along with record-keeping and an approval process for our administration. I’d also like to start studying for the VCAP-DCA 5 when it becomes available, which I assume will be in 2012. My company, along with many others are beginning to move TO THE CLOUD! and our architect has already reached out to me and another engineer to help guide the company in the right direction for that initiative. I haven’t worked much with cloud-based environments in the way we need to utilize them but I am up for the challenge as it will provide some great experience! The last thing I need to do more of in 2012 is create technical documentation and develop a usable portal for our other technical teams to access it if needed.

Everything I plan to study, develop, and accomplish in 2012 will be leading up to possible bigger and better opportunities in 2013!

November 21, 2011
by zach
0 comments

Enable Audio Communication within a VM

Recently our team received a request to build a VM with remote desktop services. A bunch of new contractors would have a controlled sandbox personal desktop environment on the same VLAN as other servers within their environment. We deployed the server using Windows 2008 R2 with all of their requested applications, including Lync. This morning they alerted me that they weren’t able to initiate a call using Lync because there weren’t audio devices available. This server is running on vSphere 4.1 and the hosts don’t have audio devices to pass through to the VM. Therefore, audio and recording redirection needed to be enabled on the server. First, the local computer policy needs to allow the redirection. Follow these steps:

Open MMC
File > Add/Remove Snap-in
Select Group Policy Object Editor and click Add
Leave the Local Computer selected and click Finish
Click OK to open the Local Computer Policy
Expand the tree in the following order:

  • Local Computer Policy
  • Computer Configuration
  • Administrative Templates
  • Windows Components
  • Remote Desktop Services
  • Remote Desktop Session Host
  • Device and Resource Redirection

Double click “Allow audio and video playback redirection” and “Allow audio recording redirection”. Enable both and Apply.
Double click “Limit audio playback quality” and Disable and Apply.

The audio playback configuration is now complete on the server-side. I found out that the audio recording redirection requires one additional step, within the registry. Open regedit and drill down through the following:

HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TCP

Find the “fDisableAudioCapture” REG_DWORD and change the value from 1 to 0 so the data reflects 0x000000000 (0)

Log Off of the server. This concludes the server-side set up.

From the client side, a couple options need to be configured:

Open Remote Desktop Connection client and click “Show Options” in the bottom left.
Click the Local Resource tab
Click the Settings button under Remote Audio
A new window will be displayed. Select “Play on this Computer” and “Record from this computer.”
Click OK and logon to the server.

 

Once logged onto the server, open Lync and confirm the Audio Device Settings. It should mimic the following screenshot:

Now you will be able to make Lync calls from within a VM!

November 4, 2011
by zach
0 comments

VCP5 Exam: Passed

Last week I finally got around to scheduling my VCP5 exam. I gave myself ten days to study hard and get fully prepared. The first five days, I dabbled around in the usual sites and began memorizing the configuration maximums. I didn’t push myself too hard and I ended up studying like crazy in the 2-3 days prior to yesterday. I read a few VCP5 test experiences and got a better understanding of how the 5 exam had been changed compared to the old VCP4 exam. I also studied the configuration maximums and took many prep tests. A few hours before the test, I had exhausted myself of cramming. I went in confident and came out with a passing grade with 30 minutes to spare.

I suggest the following before taking the test:

  1. Don’t worry about the configuration maximums very much. – My question bank had very little to do with them
  2. Study up on vDS implementations.
  3. Get your thinking cap on as there are many real-world troubleshooting examples.
  4. Don’t over think the answers, they are not trying to trick you!
  5. Go over the new vSphere 5 features and upgrade paths.

My recommended VCP5 study resources can be found here.

October 19, 2011
by zach
1 Comment

VMware Tools Update on Power Cycle

The environment that I support has close to 1,000 virtual guests with many of them running out of date VMware Tools. The out of date status was more of a cosmetic issue for a while until a few guests had unexpected crashes, which were later diagnosed by VMware support as to be related to the old version of tools. The tools crashes weren’t happening often, but they were occurring. Updated tools were in need.

I tried a few methods to update all of our Windows-based guests during our scheduled once a month maintenance weekend. The first plan was to update the tools the Friday night before out Saturday morning Windows updates/reboot. I wrote a simple PowerCLI script to initiate the tools upgrade from vCenter. I threw in the no reboot switch to delay the reboot until morning. Just over half of the VMs updated. The remaining that failed, were in an “updating tools” state on vCenter and it couldn’t be cancelled. I was able to kill the process by logging into the hosts and killing it from there. I attempted to narrow down the cause as to why many didn’t upgrade and vCenter’s initiation failed. I tried a few “solutions” that I came up with from other users but none of them worked. I was also unable to find any correlation as to why some updated and some didn’t. There were guests that were identical to other guests (load balanced web servers) that failed when some succeeded. Our team thought up of a few more ways we could push updated tools but all required too much work and planning.

One of us came across the “Check and upgrade Tools during power cycling” checkbox within the guest’s properties. This seemed optimal but we weren’t sure if the Windows updates would interfere with the Tools update when the server began the power cycle. We decided to go with it as there are other random times that our servers are rebooted for various reasons. In the end, they would take care of themselves. Perfect! Now to tick that checkbox on close to 1,000 guests. We could call in the interns…. They’d probably miss a few. There had to be a way to do it in PowerCLI! My co-worker came up with the script initially and we worked through some kinks to finally make it work. We kicked it off in our DR facility to say we performed “testing” before we started changing things in our production datacenter. No issues. In the end, the script took less than 20 minutes to tick the checkbox for all Windows guests.

The work done by the script is shown below:

 #Get Windows Guest machines in datacenter from vCenter server
$vmguests = Get-Datacenter $datacenter | Get-VM | %{Get-View $_.ID} | where {$_.Guest.GuestFamily -match "windowsGuest"}
 
#Create new Virtual Machince Config Spec
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
 
#Write new config options to VMs
foreach ($vm in $vmguests){
 
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.tools = New-Object VMware.Vim.ToolsConfigInfo
$vmConfigSpec.tools.toolsUpgradePolicy = "upgradeAtPowerCycle"
 
$vm.ReconfigVM_Task($vmConfigSpec)
}

After running the script in DR and against our production guests, it completed in around 20 minutes total. The results were great after the first maintenance weekend. Many environments were exempt from our last maintenance weekend but just over half of our Windows guests now have updated tools because of this script.

The script can be downloaded from here.

————————————-

Caution! This background process has been altered in vSphere5 and is described here.

October 1, 2011
by zach
0 comments

Disable SSH Alert Script

After posting how to disable the SSH alert through the GUI, a request came in for a script to automate the process. You ask, you shall receive!

If the SSH service is started in ESXi, an alert will be displayed on the host. This simple script will disable the alert for all hosts in your vCenter. The meat and potatoes of the script can be found below:

# Connect to vCenter using the variables above
Connect-VIServer -Server $VIServer -User $VC_User -Password $VC_Pass
 
# Gather all hosts connected to vCenter 
$Hosts = Get-VMHost
 
# Suppress the warning to all hosts
Set-VMHostAdvancedConfiguration -VMHost $Hosts -Name UserVars.SuppressShellWarning -Value 1
 
# Disconnect from vCenter
Disconnect-VIServer -Server $VIServer -Confirm:$false

The entire script can be downloaded from here.

September 30, 2011
by zach
0 comments

Disable SSH Alert on vSphere 5

Earlier this week, I was in a vSphere 5 ICM class and SSH access was brought up. Most of the students in the class that have used ESX in the past have been quite accustomed to using SSH for various tasks. Our instructor showed us how to enable SSH from the vSphere client. We were then shown the alert that is displayed in the Summary tab when SSH is enabled.

SSH Alert

In the Hosts and Clusters view, the host icon also displays an alert on the host.

Host Alert

A classmate asked if this could be disabled. Our instructor looked it up and found a KB Article indicating the alert couldn’t be disabled. I was pretty sure it could be as I thought I had seen a discussion about it a couple of months ago. I then found KB Article 2003637. The KB describes how to disable the annoying alert. Select your host and click the Configuration tab. Click Software > Advanced Settings and go to UserVars. Scroll to the bottom to find UserVars.SessionShellWarning and change the value to 1.

Disable SSH Alert

The alert is now missing!

September 30, 2011
by zach
0 comments

VCP5 Exam Prep

I finished VMware’s vSphere ICM class today in preparation for the VCP5 exam. I’ve managed a vSphere environment for a couple of years now and feel I am prepared for the exam. Our instructor gave us a few tips on the kind of questions that will be presented. I plan to study up on the configuration maximums and ports used by vSphere. I’ll also be hitting up the exam blueprint and Simon Long‘s VCP5 resources. I plan to take the exam in the upcoming weeks. After that, I’ll begin studying for the VCAP-DCA. Studying VMware technologies is so much more enjoyable than formal classes at a university!

September 18, 2011
by zach
0 comments

1st Post

Welcome to the Get-VM blog! I started this blog for a few reasons. I read many popular blogs like everyone else and decided I would like to share my experiences and views on technology, especially virtualization, as well as getting myself more involved in the community. Over the past few years I have been placed into the role of managing my company’s virtual environment, running on VMware’s vSphere product. I am now working to bring in emerging technologies and helping our remote offices consolidate their servers with virtualization. I already have a few series’ of blog entries planned. Most are related to my current job projects. I will also be posting powercli scripts that are regularly used within our environment to automate many repetitive processes. Come back soon for further updates. Thanks for stopping by!