Monthly Archives: September 2012

Friday Shorts – .net AJAX Autocomplete with no webservices, youcanthavethisforapassword, Education VMUGS and more

Alright, here we go, week 2 of this series of posts…enjoy ūüôā

Using the AJAX Autocomplete in .net without engaging web services

I’ve found a new appreciation for the autocomplete functionality that languages such as ColdFusion provide out of the box. In a .net project I have been working on I simply wanted to have a textbox where the end user could begin typing in a students name and have the application make suggestions based on what they were typing and what was stored in one of my database tables. Easy enough right? No! You see, most of my googling resulted in setting up webservices to serve the data to the textbox. All in all it seemed pretty ugly. In the end I figured out how to avoid the webservices call altogether following a great article on aspsnippets.com. Obviously you need to tweek to get the results you want, but it all works in the end…trust me!

Seriouisly Microsoft – Only 16 character passwords

I seen a tweet from John Troyer this week which eventually lead me to this article. Now it seems kind of ridiculous to me! What’s the logic in only letting people have a 16 character password? Now my password is a lot less than that and I probably wouldn’t have one any bigger than that but still…It just doesn’t make sense why they would limit a password length – why lessen your security? And what have they done with those users that are already over 16 characters. The section on whether or not they have only hashed the first 16 characters of your password is interesting and honestly I wouldn’t be surprised if that is the way they went. Either way, it’s a great article, have a read and see if you are as dumbfounded as me…

Vertical based VMUGS

In an effort to share knowledge, learn from our peers and just plain ol’ get together we are now, along with a handful of other public school districts are getting together to share ideas, fixes, scripts, etc with each other. So this is planned for a few times a year and based on certain common types of technologies that we all work with, VMware being one of them. That got me to thinking. I love the structure of the VMUGs and I find them extremely valuable on a personal and a business level. However, implementing something into an educational environment vs almost any other environment is a completely different type of beast! There’s a slew of requirements and constraints associated with education. I’d love to see a series of VMUGs or learning sessions or whatever they could be called be held based on business vertical. Off the top of my head you could have Education, Healthcare, Government, etc…. Not saying we need one per quarter, but a couple per year would be cool…ah well, a man can dream…

Happy Birthday mwpreston dot net

As you’ve probably already guessed from the name of this post mwpreston dot net is finally in the books as being one year old. Honestly this is a fairly big accomplishment for me. It’s been a long ride since those first few blog posts (Hey, Who’s the new guy? and VMworld 2011 and the community that surrounds it) ¬†Before starting this blog I have tried on numerous occasions to start others, all sort of falling by the wayside and ending up with me just giving up! So what was my key to obtaining success with this one? I’m not really sure, I think just sticking with it and comitting the time to try to get at the very least one post a week out there. Finally I started to get some readers, then the sponsors came and its been a great ride since then!

So what has the first year entailed for this blog? Well, for starters I’ve had some great sponsors (Veeam, PHD Virtual, AppAssure, Starwind and BitRefinery) come on board. This¬†definitely¬†helps cover costs of hosting and gear that it takes to produce the content. I’m very grateful to have them on the site! Secondly this blog played a pivotal role in my reciving the vExpert designation for 2012. I can’t tell you how much that award means to me. To be recognized by the company who’s technology you have so much passion for is amazing and humbling. And lastly (but most certainly definetly not even close to least) this blog has given myself the avenue to share back any knowledge I can with the community that I love and have learned so much from! A community that has brought me from your standard sysadmin, to a VCP, to a VMworld attendee to a vExpert! Its truly awesome to be able to share, engage, and participate within this group!

And to close out this wonderful birthday I have a few tidbits of stats to share…

That’s really all I have for now. Although some of the numbers are low I’ve very proud of the success I’ve had thus far and very grateful for my readers and their comments they have left. ¬†Thank you all so much for reading and Ill do my best to continue to blog as much and as often as I can.

Friday Fixes and Feelings – .net validation, NHL Lockouts, iOS 6 and more

Ok, so here is my attempt at weekly post that will contain a whole lot of random fixes and tweaks that I’ve done or learned throughout the week. ¬†This may or may not have to do with virtualization or even technology for that matter. It’s basically just an assortment of random thoughts, fixes, and links ¬†that really don’t warrant a full blog post yet I still would like to share with the world ūüôā

So here we go…

Validating hidden form elements in asp.net

I’ve been playing with .net for the past few weeks and ran into a situation where I wanted to have a hidden form element but still use asp’s field validation with it. ¬†I thought I could just do the following and set the visible property to false

<asp:TextBox ID="MyHiddenField" visibile="false" minlength="1" runat="server"></asp:TextBox>

However this seems to cause the <asp:requiredFieldValidator> to not process the textbox at all. ¬†So in order to get this to work you need to use the old school css way to hide it like follows…

<asp:TextBox ID="MyHiddenField" style="display:none;"  minlength="1" runat="server"></asp:TextBox>

Your validation should now work as expected ūüôā

iOS 6 – I got in at 1:03

So the new Apple iOS 6 was released on Wednesday at¬†roughly¬†1pm. ¬†At about 1:15 I had it on my iPad. ¬†Honestly, I don’t see much of a difference but I’m not a heavy iPad user anyways…As well, I only have an iPad 2 so no SIRI for me ūüôĀ – In hindsight it’s probably for the best as those people that sit on buses and trains talking into their iPhone/iPad look a tad bit crazy IMO. ¬†Siri, make me a sandwich!

Some really annoying PowerShell

Arggghh! ¬†All I want to do is create an OU and specify turn off the Protect from accidental deletion flag. ¬†Guess what? ¬†There’s no -ProtectFromAccidentalDeletion option on the New-ADOrgranizationalUnit cmdlet, only on the Set-ADOrganizationalUnit cmdlet. ¬†I know you could | and do crazy PowerShell Guruness like type things to get it one line but it’s still annoying! ¬†Why can’t I just do it all with the New cmdlet? ¬†Oh well, this will have to do…

New-ADOrganizationalUnit -Name "OU_Name" -Path "Path_to_parent OU"
Set-ADOrganizationalUnit -Identity "OU=Full_Path_To_OU" -ProtectedFromAccidentalDeletion $false

Looks like no NHL season – for now!

So the day that everyone knew would come has came and went and the NHL players have been locked out! ¬†Although I understand that professional sports leagues need to be run like a business and it’s always dicey when money is involved it sucks that the two sides just can’t come to an agreement or tentatively use the previous one – for the sake of the game and the fans. ¬†Speaking of fans – if the league is indeed a business then the fans would most certainly be their customers – and if the store is no longer there, customers will go somewhere else. ¬†Here’s hoping the NHL can get there $%@! together and get on the ice!

My son started hockey for the first time.

Speaking of hockey, my son Hayden went to hockey for the first time this year and in his life! ¬†He was pretty pumped to go (as was I) and did great! ¬†He was in a skating program last year which really helped, but it is certainly a different kind of beast when you attach a ton of equipment to such a little body and throw them on the ice! ¬†I’m glad I was able to join him out there as I think it really helped. ¬†Anyways, he goes twice a week so there is lots of time to improve.

Hey Montreal – Sign Subban already!

¬†I said in my¬†about page¬†that you may see the odd rant about the habs and it may have taken a year but I’m ready to do that now! ¬†PK Subban is perhaps one of the most electric, fan pleasing players to hold the blue line position inside the Bell Centre in a long time. ¬†He’s young, strong, and exciting to watch. ¬†The fans love him, the rivals hate him – Why is this guy not signed yet. ¬†I understand that the lockout certainly causes complications but what I don’t understand is why the Montreal Canadiens organization seem to devalue these types of players, players that could stay and be a fan¬†favourite¬†for a long time. ¬†They have already inked their young goaltender Carey Price and are ensuring that he will stay around for at least 6 years. ¬†Why not just complete the bromance? ¬† Just sign him already before he goes somewhere else and lights it up.

Yet another VMworld wrap-up (I know, I’m really late to the party)

I know, VMworld is sooooo two weeks ago, the biggest announcement of vSphere 5.1 has already been delivered and is GA and the world is all basking in its new features and enhancements, the vCloud suites have been blogged to death, most of the sessions have even been made available on the VMworld Socialcast site, so why go and throw yet another VMworld post out there? Well, it was VMworld last year that gave me the final push to start this blog (see post here) and a lot of vGoodness has happened to me since then ( sponsors, certifications, vExpertiness) so I guess i just feel like i owe it to the VMworld gods to throw out my experience at the show.

Last year was my first VMworld and to tell you the truth i had no idea what to expect and after the first day lets just say i was a little overwhelmed, crazy tired and a whole lot excited. So this year i knew what to expect and thought i was more than enough prepared for the awesomeness the show could throw at me….well, not really, i was left with the same symptoms i had in 2011. I had no idea what was in store for me that week in San Francisco but by no means was I ready for what was to unfold. A few highlights of my week below…

I got to meet Pat Gelsinger and Steve Herrod at the CTO reception. How cool is that? You know, just chattin it up with CEO and CTO of the billion dollar company that produces the software that has been consuming every ounce of your free time.  Let me say, being a vExpert at VMworld is pretty awesome!

I had dinner with a bunch of rockstars. I had the chance to sit down and have a fabulous dinner with John Troyer, Martin Klaus, Ben Scheerer, David Davis, Eric Sloof, Tommy Trogden, and vCOps contest winner Joe Filippello. ¬† Due to the massive amount of brainpower in that room you can imagine there were some great conversations – and the food was fabulous. Thanks Ben for the invite and the re-invite ūüôā

My session (OPS-CIM1940). I had the opportunity to participate in a panel session (titled Real World stories of Operational Performance Troubleshooting, Capacity, and Configuration management with vCenter Operations Suite) with a few other attendees and present my stories and experiences with vcops to over 600 people. Never had I spoke in front of that many people before so i was a little nervous but overall i think the session went great and am thankfull for the opportunity

Last but not least is this group of guys (and girl). Honestly they truly make the conference what it is. Most i knew from Twitter¬†already. ¬†Some I met at VMworld 2011, and some I met for the first time this year. ¬† These guys truly made the social part of the conference awesome! ¬†Great group of guys and watch big things to come out of this group ūüôā
There really isn’t much information in this post that anyone will benefit from in it and it probably comes off like a little bit of bragging (cuz it is :)). ¬†Either way I guess one takeaway you can pull out of it is get yourself to a VMworld! ¬† Aside from the massive amount of technical information you can bring back, the real value is the contacts you make. ¬†Every subject matter expert is there and no question I had during the show went unanswered, so just get there! ¬†See you in Barcelona!!! – actually I won’t but it just sounded like a good ending…. ūüôā

Customize the VMware vSphere Health Check to only email report if there is a hardware issue.

One of the things that I love most about utilizing vCenter Server to manage my hosts is the ability to generate a nice little email alert when any hardware within my hosts decides to go a little offside. ¬†That being said there are a lot of times when I don’t have vCenter and am trying to monitor hardware failures on the free ESXi Hypervisor. ¬†This as always been a challenge of some sorts and usually the solution that I end up using is William Lam’s vSphere Health Check Report on top of the vSphere Management Assistant (VMA).

The vSphere Health Check report is an awesome perl script written by William Lam that generates a very thorough report containing almost everything you would need to know about a host and the VMs that are residing on it. ¬†After the script is done running you get a nice little email such as the following….

As you can see there is a slew of information included in the health check report – and don’t take this the wrong way, this is all great information and very nice to have as a little report waiting for you in your inbox every morning ¬†Howerver, the goal I had was to take this script, add it to a cronjob on my VMA, and modify the code so that I only get an email and the attached report if I have a hardware issue. ¬†So to get started go ahead and get your VMA setup if you havn’t already (I think you can use any version of the remote CLI if you don’t have VMA) and go and download version 5.02 of the VMware vSphere Health Check report (The instructions to configure and install it are on the download page as well).

So, now with the customization, around Line 289 (your line numbers may differ as I’ve been in there hitting enter :)) I’ve added a few variables. ¬†$HOSTISSUES is simply going to be a boolean variable that we will flag as yes if we run into any warnings or errors when parsing the hardware health and $emailMessage is a variable that will house those issues so we can place them directly inside the body of the message.

my $VM_TOOL="yes";
my $VMW_APP="yes";
my $VPX_SETTING="yes";

#mwpreston - additions 
my $HOSTISSUES="no"; 
my $emailMessage="";

############################
# START OF SCRIPT
############################

So on we go into the meat and bones of the script. ¬†Around line1930 or so you should see where the script actually goes in and checks the health of the hosts. ¬†Basically what I have done here is if the script finds any issues at all from within this section (anything that isn’t green) I will flag $HOSTISSUES to yes and append the issues to $emailMessage. ¬† I’ve highlighted each spot below where I have added code but you can chose to add it where you like, meaning if you don’t care about a memory error, don’t include it there, etc…

######################
# HEALTH
######################
if($HOST_HEALTH eq "yes") {
	if($local_host->runtime->healthSystemRuntime) {
		if($local_host->runtime->healthSystemRuntime->hardwareStatusInfo) {
			my $hardwareStatusInfo = $local_host->runtime->healthSystemRuntime->hardwareStatusInfo;
			my ($cpuInfo,$memInfo,$storageInfo);
			$healthHardwareString .= "<tr><th align=\"left\">".$host_name."</th></tr>\n";
			my ($sensor_health_color,$sensor_health) = ("","");;

			if($hardwareStatusInfo->cpuStatusInfo) {
				$cpuInfo = $hardwareStatusInfo->cpuStatusInfo;
				foreach(@$cpuInfo) {
					$sensor_health = $_->status->key;
					if ($sensor_health =~ m/green/i) { 
						$sensor_health_color="<td bgcolor=\"$green\">OK</td>"; 
					}
					elsif ($sensor_health_color =~ m/red/i)	{ 
						$sensor_health_color="<td bgcolor=\"$red\">PROBLEM</td>";
						#MWPRESTON - added following 2 lines
						$HOSTISSUES="yes"; 
						$emailMessage .= $_->name."\n"; 
					}
					elsif ($sensor_health_color =~ m/yellow/i) { 
						$sensor_health_color="<td bgcolor=\"$yellow\">WARNING</td>"; 
						#MWPRESTON - added following 2 lines
						$HOSTISSUES="yes"; 
						$emailMessage .= $_->name."\n"; 
					}
					else { 
						$sensor_health_color="<td bgcolor=\"gray\">UNKNOWN</td>"; 
						#MWPRESTON - added following 2 lines
						$HOSTISSUES="yes"; 
						$emailMessage .= $_->name."\n"; 
					}
					$healthHardwareString .= "<tr><td>".$_->name."</td>".$sensor_health_color."</tr>\n";		
				}
			}
			if($hardwareStatusInfo->memoryStatusInfo) {
				$memInfo = $hardwareStatusInfo->memoryStatusInfo;
				foreach(@$memInfo) {
					$sensor_health = $_->status->key;
					if ($sensor_health =~ m/green/i) { 
						$sensor_health_color="<td bgcolor=\"$green\">OK</td>"; 
					}
					elsif ($sensor_health_color =~ m/red/i) { 
						$sensor_health_color="<td bgcolor=\"$red\">PROBLEM</td>"; 
						#MWPRESTON - added following 2 lines
						$HOSTISSUES="yes"; 
						$emailMessage .= $_->name."\n"; 
					}
					elsif ($sensor_health_color =~ m/yellow/i) { 
						$sensor_health_color="<td bgcolor=\"$yellow\">WARNING</td>"; 
						#MWPRESTON - added following 2 lines
						$HOSTISSUES="yes"; 
						$emailMessage .= $_->name."\n"; 
					}
					else { 
						$sensor_health_color="<td bgcolor=\"gray\">UNKNOWN</td>"; 
					}
					$healthHardwareString .= "<tr><td>".$_->name."</td>".$sensor_health_color."</tr>\n";
				}
			}
			if($hardwareStatusInfo->storageStatusInfo) {
				$storageInfo = $hardwareStatusInfo->storageStatusInfo;
				foreach(@$storageInfo) {
					$sensor_health = $_->status->key;
					if ($sensor_health =~ m/green/i) { 
						$sensor_health_color="<td bgcolor=\"$green\">OK</td>"; 
					}
					elsif ($sensor_health_color =~ m/red/i) {
						$sensor_health_color="<td bgcolor=\"$red\">PROBLEM</td>";
						#MWPRESTON - added following 2 lines
						$HOSTISSUES="yes"; 
						$emailMessage .= $_->name."\n";
					}
					elsif ($sensor_health_color =~ m/yellow/i) { 
						$sensor_health_color="<td bgcolor=\"$yellow\">WARNING</td>";
						#MWPRESTON - added following 2 lines
						$HOSTISSUES="yes";
						$emailMessage .= $_->name."\n";
					}
					else { 
						$sensor_health_color="<td bgcolor=\"gray\">UNKNOWN</td>";
						#MWPRESTON - added following 2 lines
						$HOSTISSUES="yes";
						$emailMessage .= $_->name."\n";
					}
					$healthHardwareString .= "<tr><td>".$_->name."</td>".$sensor_health_color."</tr>\n";
				}
			}
		}
		if($local_host->runtime->healthSystemRuntime->systemHealthInfo) {
			my $sensors = $local_host->runtime->healthSystemRuntime->systemHealthInfo->numericSensorInfo;
			$healthSoftwareString .= "<tr><th align=\"left\">".$host_name."</th></tr>\n";
			my $sensor_health_color = "";
			foreach(sort {$a->name cmp $b->name} @$sensors) {
				my $sensor_health = $_->healthState->key;
				if ($sensor_health =~ m/green/) { 
					$sensor_health_color="<td bgcolor=\"$green\">OK</td>"; 
				}
				elsif ($sensor_health_color =~ m/red/) { 
					$sensor_health_color="<td bgcolor=\"$red\">PROBLEM</td>";
					#MWPRESTON - added following 2 lines
					$HOSTISSUES="yes";
					$emailMessage .= $_->name."\n";
				}
				elsif ($sensor_health_color =~ m/yellow/) { 
					$sensor_health_color="<td bgcolor=\"$yellow\">WARNING</td>"; 
					#MWPRESTON - added following 2 lines
					$HOSTISSUES="yes";
					$emailMessage .= $_->name."\n";
				}
				else { 
					$sensor_health_color="<td bgcolor=\"gray\">UNKNOWN</td>"; 
					#MWPRESTON - added following 2 lines
					$HOSTISSUES="yes";
					$emailMessage .= $_->name."\n";
				}
				my $reading;
				if(defined($_->rateUnits)) {
					$reading =  &restrict_num_decimal_digits(($_->currentReading * (10 ** $_->unitModifier)),3) . " " . $_->baseUnits . "/" . $_->rateUnits;
				} else {
					$reading =  &restrict_num_decimal_digits(($_->currentReading * (10 ** $_->unitModifier)),3) . " " . $_->baseUnits;
				}
				$healthSoftwareString .= "<tr><td>".$_->name."</td><td>".$reading."</td>".$sensor_health_color."</tr>\n";
			}	
		}
	}
}

And finally you need to modify the emailReport function in order to check for HOSTISSUES (since we don’t want to email unless we have an issue) and also attach $emailMessage to the body of the message. ¬†This function is near the top of the script starting at roughly line 325. ¬†My changes are below….

sub emailReport {
	#MWPRESTON - modified if statement to include HOSTISSUES
	if($email eq "yes" and $HOSTISSUES ne "no") {
		my $smtp = Net::SMTP->new($EMAIL_HOST ,Hello => $EMAIL_DOMAIN,Timeout => 30,);

		unless($smtp) {
	                die "Error: Unable to setup connection with email server: \"" . $EMAIL_HOST . "\"!\n";
        	}

		open(DATA, $report) || die("Could not open the file");
		my @report = <DATA>;
		close(DATA);

		my @EMAIL_RECIPIENTS = $smtp->recipient(@EMAIL_TO,{SkipBad => 1});
		my $boundary = 'frontier';
		$smtp->mail($EMAIL_FROM);
		$smtp->to(@EMAIL_TO);
		$smtp->data();
		$smtp->datasend('From: '.$EMAIL_FROM."\n");
		$smtp->datasend('To: '.@EMAIL_TO."\n");
		$smtp->datasend('Subject: VMware vSphere Health Check Report Completed - '.giveMeDate('MDYHMS'). " (" . $system_name . ")\n");
		$smtp->datasend("MIME-Version: 1.0\n");
		$smtp->datasend("Content-type: multipart/mixed;\n\tboundary=\"$boundary\"\n");
		$smtp->datasend("\n");
		$smtp->datasend("--$boundary\n");
		$smtp->datasend("Content-type: text/plain\n");
		$smtp->datasend("Content-Disposition: quoted-printable\n");
		#MWPRESTON - added following 2 lines.
		$smtp->datasend("\nProblems have been detected with the following\n");
		$smtp->datasend("\n$emailMessage\n");
		$smtp->datasend("\nReport $report is attached!\n");
		$smtp->datasend("--$boundary\n");
		$smtp->datasend("Content-Type: application/text; name=\"$report\"\n");
		$smtp->datasend("Content-Disposition: attachment; filename=\"$report\"\n");
		$smtp->datasend("\n");
		$smtp->datasend("@report\n");
		$smtp->datasend("--$boundary--\n");
		$smtp->dataend();
		$smtp->quit;
	}
}

If you would like the complete modified script you can get it here – honestly, I would¬†recommend¬†going and downloading Willams version first ¬†and then make the required changes to it. ¬†Since his script seems to be actively updated and worked on, whereas mine here will probably remain pretty static. ¬†Again, I haven’t thoroughly tested this and it’s a use at your own risk type thing – and I’ve only applied these changes in version 5.02 of Williams script.

Again, any comments, concerns, questions, or if you just need help setting up the script or cron job let me know in the comments box below.

Hide those ‘Getting Started’ tabs in the #vSphere 5.1 Web Client

OK another quick post with some hopefully useful information for someone..

Remember these?

And how we could select Edit-Client Settings and uncheck the following box to get rid of them.

That was great, but guess what, now we have these….

So how do we get rid of them. ¬†Easy! – Just go to help and select ‘Hide All Getting Started Pages’

There you go, all gone Рyou know longer have to sit and read the definitions of what a Cluster or Datacenter is!!!  Just throwing this out there due to the fact that those tabs tend to annoy the crap out of me!  #JustSayin 

The infrastructure behind this post was provided by #vAutoLab. ¬†What? ¬†Serious? ¬†You’ve never heard of it? ¬†Craziness, get on over to www.labguides.com and give it a go! ¬†It’s awesomesauce!

New StarWind Whitepaper – Why Is 3-Way Synchronous Mirroring Better Than 2-Way?

StarWind Software, a global leader in storage management and SAN software for small and midsize companies (or in the community terms – the company with the iSCSI SAN) has released a new whitepaper titled ;’Why Is 3-Way Synchronous Mirroring Better Than 2-Way?’

This white paper describes the difference between 3-and 2-way synchronous mirroring Рcapabilities that are both available in the StarWind iSCSI SAN & NAS solution. The document outlines the advantages of the 3-node high availability storage cluster that provides cost efficiency, increased reliability, and higher performance compared to 2-node HA.  You can go and grab a copy of it here.  While your there, you might as well grab yourself a copy of their FREE iSCSI SAN and try it out to see if it has a fit for you.

Creating Roles and adding Active Directory Users & Groups to the role through PowerCLI

As of late I’ve been working on a PowerCLI script to assist me with the deployment of around 50 or so ESXi hosts. ¬†For the most part the PowerCLI cmdlets have been pretty self explanatory and pretty simple to use. ¬†Really I just need to setup some DNS, Hostnames, Networks, Datastores, NTP settings, and permissions…you know, everything you would normally do when setting up a host. ¬†The problem I’ve ran into is when I hit that permissions section.

Essentially what I wanted to do was create a new role containing only those permissions that I wanted then simply assign an active directory group to that role. ¬†So the role part, not too bad, pretty simple really…I used the following…

New-VIRole -Name "Elevated VM User" -Privilege (Get-VIPrivilege -ID "VirtualMachine.Interact")
Get-VIRole "Elevated VM User" | Set-VIRole -AddPrivilege (Get-VIPrivilege -ID "ScheduledTask.Run")
Get-VIRole "Elevated VM User" | Set-VIRole -AddPrivilege (Get-VIPrivilege -ID "ScheduledTask.Create")
Get-VIRole "Elevated VM User" | Set-VIRole -AddPrivilege (Get-VIPrivilege -Name "Power")
Get-VIRole "Elevated VM User" | Set-VIRole -AddPrivilege (Get-VIPrivilege -Name "Maintenance")

Basically this just creates my new role (Elevated VM User) and adds a handful of permissions to it. ¬†In order to find out the name for all the priveleges I simply just ran Get-VIPrivelege -Role ‘Admin’.

So now that I had my role created I just need to add an AD Account to that role. ¬†A lot of the documentation led me to the New-VIPermission cmdlet – sounds easy, but running the following New-VIPermission -Role ‘Elevated VM User’ -Principal ‘DOMAIN\Username’ produced nothing but the following errors for me….

New-VIPermission : 9/12/2012 2:47:40 PM New-VIPermission Could not find VIAccount with name ‘Domain\Username’.
At line:1 char:17
+ New-VIPermission <<<< -Role ‘Admin’ -Principal ‘Domain\Username’
+ CategoryInfo : ObjectNotFound: (Domain\Username:String) [New-VIPermission], VimException
+ FullyQualifiedErrorId : Core_ObnSelector_SelectObjectByNameCore_ObjectNotFound,VMware.VimAutomation.ViCore.Cmdlets.Commands.PermissionManagement.NewVIPermission

New-VIPermission : 9/12/2012 2:47:40 PM New-VIPermission Value cannot be found for the mandatory parameter Entity
At line:1 char:17
+ New-VIPermission <<<< -Role ‘Admin’ -Principal ‘Domain\Username’
+ CategoryInfo : NotSpecified: (:) [New-VIPermission], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.PermissionManagement.NewVIPermission

Now it seams as if me passing the string of ‘Domain\Username’ is not satisfying whatever object it is that -Principal is looking for. ¬†So after a many googling and twittering the following code is how I ended up assigning Domain\Username to the role I created.

$groupName = "Domain\Username"
$currhost = get-vmhost HOSTNAME | % {Get-View $_.Id}
$authmgr = Get-View AuthorizationManager-ha-authmgr
$perm = New-Object VMware.VIM.Permission
$perm.Principal = $groupName
$perm.group = $true
$perm.propagate = $true
$perm.RoleId = ($authmgr.RoleList | where {$_.Name -eq "Elevated VM User"}).RoleId
$authmgr.SetEntityPermissions($currhost.parent,$perm)

And this worked perfect! ¬†As I’ve always said I’m sure there are a million ways to do something and if you think your way is more efficient or better than mine, please share! ¬†This is my first crack at it so all suggestions and comments are always welcome ūüôā

Free VMware vSphere 5.1 What’s New Training – Yup! Free!

Once again VMware has released another self paced online piece of training for the low low cost of absolutely nothing. ¬†Hey, if it’s free why not give it a go right? ¬†I’ve never been one to turn down free training of any kind so I’ve started to go through the course myself…

Certainly the free courses that they release do not cover near as much or go as a deep technically as any of their official paid courses but they are a great way to learn the basic functionality and get a great overview of the products they cover. The What’s New in VMware vSphere 5.1 course gives you a great overview of most of the new features that were jam packed into this new release and will for sure help in your day to day administering of your environment.

The course objectives straight from mylearn are below…or the official course details are here.

‚Äʬ†¬†Compute and Storage
o  Support for hardware version 9, the latest CPU performance counters and virtual shared graphics acceleration designed for enhanced performance.
o  For better space efficiency vSphere supports storage space reclamation for VDI.
‚Äʬ†¬†Network
o  Support for VXLAN
o¬†¬†Enhanced vSphere Distributed Switch‚ĄĘ that supports:
Ôā߬†¬†Network health check
Ôā߬†¬†Backup and restore
Ôā߬†¬†Rollback and recovery
Ôā߬†¬†Link Aggregation Control Protocol support
Ôā߬†¬†Single-root I/O virtualization (SR-IOV)
‚Äʬ†¬†Availability
o¬†¬†VMware vSphere vMotion¬ģ without the need for shared storage configurations.
o  VMware vSphere Data Protection for simple and cost effective backup and recovery,
o  vSphere Replication enables efficient array-agnostic replication of virtual machine data over the LAN or WAN.
‚Äʬ†¬†Security: Inclusion VMware vShield Endpoint‚ĄĘ to eliminate the agent footprint from the virtual machines, offload intelligence to a security virtual appliance, and run scans with minimal impact.
‚Äʬ†¬†Automation: Two new methods for deploying new vSphere hosts to an environment make the Auto Deploy‚ĄĘ process more highly available than ever before.
‚Äʬ†¬†VMware vCenter Enhancements:
o  vSphere Web Client
o  vCenter Single Sign-On
o  VSA enhancements
o  Support for Additional Disk Drives
o  Increase Storage Capacity Online
o  vCenter running on the VSA Cluster

So, if this looks like something you might want to check out head on over to mylearn.vmware.com and sign up! Again, it’s free!!!

Getting rid of those VM Memory Limits (you know, the ones you didn’t know existed)

OK so here’s a quick one. ¬†I know there are many other posts out there about this, i’ve come across multiple ones but again for my own documentation and for the mere fact that usually writing about something helps me to remember it I’m going to throw one more out into the mix.

I’ve¬†occasionally¬†come across a bunch of my VMs which seem for some reason to have a memory limit set on them. ¬†BTW, vCheck is a great tool for reporting on these. ¬† We all know the dangers of memory limits (swapping,¬†ballooning, etc) and to tell you the truth I’m not sure why or how they got set. ¬†I’m assuming I have a template somewhere within my environment which has a limit imposed on it. ¬†Either way, there is a quick and easy way to get rid of those limits using PowerCLI.

First off I wanted to see which VMs had lmits imposed on them from within a certain cluster in my environment.  The following command does just that.

Get-VM -Location CLUSTERNAME | Get-VMResourceConfiguration 
| where {$_.MemLimitMB -ne '-1'} | Select VM,MemLimitMB

Furthermore, If you do have some VMs that you want to have a memory limit set on and not returned here and you have some soft of consistency within their name (ie. Veeam Replica’s) you can do the following to exclude them…

Get-VM -Location CLUSTERNAME | where {$_.Name -notlike '*Replica'} 
| Get-VMResourceConfiguration | where {$_.MemLimitMB -ne '-1'} 
| Select VM,MemLimitMB

You should be left with a listing of your VMs which have a memory limit set on them…

To set these VMs limit to unlimited, just pipe in the Set-VMResourceConfiguration cmdlet as follows

Get-VM -Location CLUSTERNAME | Get-VMResourceConfiguration 
| where {$_.MemLimitMB -ne '-1'} 
| Set-VMResourceConfiguration -MemLimitMB $null

Voila! ¬†No more memory limits…as you can imagine you can do the same with CPULimitMhz. ¬†FYI, if you want to learn more about PowerShell or PowerCLI or scripting you are in the wroooooonnnnggg place, I know what I know, but most examples I get from the following people and you should really follow Alan Renouf (blog/twitter), Luc Dekens (blog/twitter), Jake Robinson (blog/twitter), William Lam (blog/twitter) Eric Wright (blog/twitter), Josh Atwell (blog/twitter) or Hal Rottenberg (blog/twitter). ¬†I’m sure I’m missing a few, these are just the ones I can remember off the top of my head, feel free to recommend some more CMDLET¬†rock stars¬†to me in the comments below…. ūüôā

Backup and Replication by VMware – New in vSphere 5.1

There have been a slew of announcements coming out of VMworld in San Francisco this week and also a slew of new products and enhancements to existing products. ¬†During the show I was attempting to look at everything from an SMB point of view and a couple of products that really stuck out for me was that of the new vSphere Data Protection and vSphere Replication. ¬†Below are just a few thoughts around each product, what it has to offer and where it is packaged from within VMwares’¬†licensing¬†editions.

vSphere Data Protection

First off let’s explore vSphere Data Protection (vDP). ¬†There has been a lot of buzz during and even before the show around vDP and how VMware plans to position it. ¬†Working closely with EMC’s Avamar development team VMware have now packaged their own backup and recovery solution into vSphere 5.1, replacing, yet still supporting its’ predecessor VMware Data Recovery. ¬†In my opinion this is a great move for VMware. ¬†vDR was not gaining too much traction within the SMB or Enterprise market however I believe that vDP will. ¬†Why? ¬†Again, it’s built on top of EMCs Avamar backup and recovery technology therefore leveraging years of experience and ‘lessons learned’ which make the product more seasoned and production ready than vDR ever was. ¬†Also this complete solution is managed and embedded directly from within the new vSphere 5.1 Web Client. From within the same menus that you clone a VM, vMotion, perform power operations you can now apply backup policies and ensure your data is safe and protected. ¬†Simply install the backup appliance and you are good to go. ¬†Now vDP is not for everyone and as with any initial release (either on purpose or not) there are some limitations. ¬†A single vDP Appliance can scale up to 2TB of deduplicated storage or 100 VMs total. ¬†Certainly targeted at the SMB market. ¬†I’m excited to see what vDP has to offer and how widely it is adopted in the SMB space. ¬†vDP is bundled in with the Essentials Plus licensing and above.

vSphere Replication


Again this is nothing new. ¬†With the last release of Site Recovery Manager (SRM) vSphere Replication was included and provided users with the ability to perform replication on a per-VM basis without the need of shared storage or costly SAN replication functionality. ¬†The problem there was it was bundled with SRM, a product in which you probably already were utilizing that costly SAN replication technology anyways. ¬†Well, in vSphere 5.1 that has all changed. ¬†Although still available within SRM, vSphere Replication now is included within the Essentials Plus and above licensing. ¬†And on top of that there have been some new features and enhancements made to vSphere Replication – VSS Support, flexible RTO, and simplified management utilizing the new vSphere 5.1 web client are just a few. ¬†Again, there are some limitations. ¬†The biggest being that there is a 2TB limit (don’t take my word on this, I thought I heard it in the session but am trying to find data to back it up, i know there is most certainly a 500 VM limit) on the amount of data that you can replicate. ¬†If you need more than this you will have to purchase the full SRM suite, that being said, still a great alternative and great news for users in the SMB space.

So, a couple of products coming out of VMworld in the realm of data protection. ¬†I’m interested to see within the next year how many people adopt and use this products. ¬†There are no fancy features being offered that you might get with some of the more established third party products such as the ability to instantly restore your VMs, run VMs directly from backup, Re-IP VMs, etc… ¬†The 2TB lmiits imposed on the backup storage do not really bother me that much, however ¬†I would have loved to also see these bundled into at the very least the Essentials ROBO kits. ¬†It would have been a great way to protect those VMs running in a remote office where only one host resides and Essentials Plus didn’t really make sense. ¬†Only time will tell how widely adopted these products will be but this is certainly a great first step for VMware in my opinion. ¬†The ability to manage all of this from directly inside the web client is huge. ¬†And the ability to protect your virtualized environment with products from your virtualization vendor is even better. ¬†I’d love to hear from you, if you plan to use either vDP or vSphere Replication, if your using it now, or even any thoughts you may have on the releases or any other news coming out of VMworld for that matter…Let me know in the comments…