Tuesday, October 6, 2009

Video Card Hardware - vSphere 4

The boss is out this week and I got all of my work done for the day so I thought I would throw up another post that I have been working on. Blogging, and most anything else, is more difficult with a newborn in your life but I wouldn't have it any other way.

I was recently messing with vSphere in my lab environment and tweaking hardware information to determine what was new with vSphere and hardware version 7. One thing that appears to be added is the ability to edit Video Card settings. I began by adjusting the video ram to 32mb and playing with the VM. Imagine my surprise when trying to vMotion the VM and I received the error:


A
general system error occurred: Failed to write checkpoint data (offset 33558328, size 16384): Limit exceeded KB 1011971

This is apparently a result of the vRAM assigned is greater than 30MB. This can be
reduced in vSphere by:
  1. Shut down the VM
  2. Right click on the VM in the inventory and select Edit Settings
  3. Click on Video Card
  4. Change value under "Enter total video RAM" to below 30MB or select "Reserve memory for the following selection" radio button.

Given this limitation I wondered what effect that may have if you have specific hardware needs for VDI or desktops in general.

Display Resolutions at 24bit color depth

Resolution

Video Ram (MB)
24bit color

Video Ram (MB)
32bit color

2 Display
24bit color (MB)

2 Display
32bit color (MB)

800x600

1.37

1.83

5.49

7.32

1024x768

2.25

3

9

12

1280x1024

3.75

5

15

20

1600x1200

5.49

7.32

21.97

29.3

1152x864

2.85

3.8

11.39

15.19

1280x800

2.93

3.91

11.72

15.63

1440x900

3.71

4.94

14.83

19.77

1680x1050

5.05

6.73

20.18

26.91

1920x1200

6.59

8.79

26.37

35.16


Fortunately the only scenario listed here that exceeds 30MB is when running 1920x1200 on two monitors. There are more configurations available but I thought this would be high on practical limit. I sincerely doubt there will be too many people screaming for dual monitors at this resolution.


On the other side of the coin, attempting to run 16bit on lower resolutions yields the error that "The video memory is limited between 1.17 MB and 128 MB. Select different number for the monitors, screen resolution, or color depth."



Running multiple Displays requires that the Virtual Machine Version be at version 7. You can do this by Right Clicking on the guest VM and selecting "Upgrade Virtual Hardware" You will receive the following warning. Keep in mind that ESX 3.5 does not support version 7 so make the upgrade wisely.


Running multiple displays can also force you to consume more video memory causing you to exceed the 30MB limit for vMotion.



I recently posed the question to a VMware sales engineer about what effect this might have on hosts when utilizing virtual desktops and needing that additional video memory resources. He assured me that he does not know of anyone reaching a level of contention but it is something they will be investigating further. I'm open to any additional information that someone may have on the subject.

Configuring Network with PowerCLI and .CSV File

A couple of weeks ago I was in need to configure several new ESX servers with multiple NICs, vSwitches, and VLANs. Since I'm not one to do the same thing over and over again I turned to scripting. To further complicate things I wanted to allow the same script to create vSwitches, configure vMotion switch, add port groups, and create NIC Teams all from a prepopulated .CSV file. I'm doing this primarily so that all configuration could be done before the server arrived and so that I could create "Switch Profiles" when I add new hosts to clusters.

In the end I developed a script that reads from a .CSV file and then creates the desired switching. The first column tells the script what type of addition it is and the script processes the information for that object accordingly. I've noticed a few others have been posting recently about scripts on setting up portgroups, etc. and thought it was time to no longer keep this to myself (i.e. finally found the time to post). I too would like to also credit Hal Rottenburg's book Managing VMware Infrastructure with Windows Powershell which was very helpful for this and many other scripting projects I will be posting soon. Mike Laverick's post linked below helped in configuring the vMotion switch.

I hope you find this helpful. It has been HUGE in my environment.

Download the files here:
ESX-ConfigureSwitchCSV-Generic.txt
esx_switching_generic.csv

Links where others discuss switch configuration with PowerCLI.
http://halr9000.com/article/828
http://www.holy-vm.com/2009/10/01/adding-port-groups-with-powercli/
http://www.rtfm-ed.co.uk/?p=1514



Text of Script w/out comments

$getinfo = Import-Csv "\\server\share\file.csv"
Connect-VIServer -Server vCenterServer

$getinfo | % {
$Type = $_.Type #!!!! Case Sensitive !!!!!!
$gethost = Get-VMHost -Name $_.HostName
$SwitchName = $_.SwitchName
$PortGroup = $_.PortGroupName
$Nic = $_.NIC
$VLAN = $_.VLAN
$IP = $_.IP
$Subnet = $_.Subnet
$kernelGW = $_.KernelGW

If ($Type -eq "Switch") {
$gethost | New-VirtualSwitch -Name $SwitchName -Nic $Nic
}
If ($Type -ne "vMotion") {
$getswitch = Get-VirtualSwitch -VMHost $gethost -Name $SwitchName
}
If ($Type -eq "Team"){
$getswitch | Set-VirtualSwitch -Nic $Nic
}
IF ($Type -eq "Portgroup") {
$getswitch | New-VirtualPortGroup $PortGroup -VLanId $VLAN
}
IF ($Type -eq "vMotion") {

$newvswitch = New-VirtualSwitch -VMHost $gethost -Name $SwitchName -Nic $Nic
$vmotion = New-VirtualPortGroup -VirtualSwitch $newvswitch -Name $PortGroup
New-VMHostNetworkAdapter -VMHost $gethost -PortGroup $PortGroup -VirtualSwitch $newvswitch -IP $IP -SubnetMask $subnet -VMotionEnabled: $true

$vmhostnetwork = get-vmhostnetwork $gethost
set-vmhostnetwork -network $vmhostnetwork -vmkernelgateway $kernelGW
}
}

Tuesday, September 22, 2009

Hmm...We need to reorganize our clusters

This isn't first time that growth has yielded a desire to repurpose or rename a cluster in my virtual environment (VI3.5 currently), but this is the first time I was determined to use Powershell to perform the task.

The goal? I need 2 clusters in an organization folder named "Production" of our Raleigh Datacenter with the names "Windows Cluster" and "Production Cluster". I already have a "Production Cluster" that is getting repurposed in the near future so it must be renamed. I will then need to create a new cluster and name it "Production Cluster" for our new production servers.

1. Log into PowrCLI and connected to my vCenter server with

Connect-VIServer -Server

2. Change the name of the current cluster "Production Cluster" to "Windows Cluster":

Get-Cluster
-Name "Production Cluster" | Set-Cluster -Name "Windows Cluster"

This requires user acceptance of the change. Just hit enter or type Y and enter to accept.

3. Create new cluster Named "Production Cluster" and enable DRS, HA, make DRS Fully Automatic, and set HA so that it will not power on VM if it will exceed resource availability limits.

Get-Datacenter -Name "Raleigh Datacenter" | Get-Folder -Name "Production" | New-Cluster -Name "Production Cluster" -DrsEnabled -HAEnabled -DrsAutomationLevel FullyAutomated -HAAdmissionControlEnabled

Hit enter and in a couple of moments you have a brand new Cluster named "Production Cluster" in the correct Datacenter and Organization folder with DRS and HA initially configured. Always a good idea to check your configurations, but all looked well.

Note: vSphere (ESX4) has additional features (VM Monitor and fully supported Power Management) to manage on your cluster. I will update this post once I get some testing on that environment.

Friday, September 4, 2009

Dying Datacenter?? Not likely folks.

The virtualization world is going nuts talking about cloud computing and how it is going to destroy the datacenter. The possibilities are intriguing but I'm pretty sure that it could easily be a decade before people think of the cloud the same way that they look at virtualization in genenral.

I just came across this scream stream at FierceCIO.com simply mentioning the possiblity and with nothing to truly back it other than a slightly obscure report from UC Berkeley. This is certainly premature and I seriously doubt that too many CIOs and CTOs are going to ever feel very comfortable handing their datacenter over to a 3rd party regardless of the cost savings. I'm still waiting to see the Fax machine and paper disappear from the corporate world. We will continue to hold onto corporate datacenters for the same reasons. On the same note, even in the cloud your servers will be in a datacenter... Just someone else's. Read the article and my response below.

Article
http://www.fiercecio.com/story/will-cloud-kill-data-center/


My Comment:
I'd say it is premature to say that the cloud is going to kill the datacenter. What I expect we will see are some organizations taking advantage of this, primarily those who need space and have already consolidated into a virtual (VMware) environment. The cloud services as mentioned here would then allow them to upload their existing application servers that they feel comfortable with having offsite, and comfortable meeting SLAs. The corporate datacenter will go away about the same time that fax machines and paper will go away. People like things that they can touch. It makes these things more tangible and comforting when you can open the door and see the lights and hear the fans. Semantics can come to play and we can say that having servers off-site isn't part of the "traditional" datacenter, but let's check back in 3-5 years and see where this has gone. My bet is that the cloud will be used like storage rental facilities; great for when you're moving or you just need a little extra space.

Tuesday, August 25, 2009

vSphere - OVF URL Issue (Am I Just Demanding?)

OK, so I haven't posted in a while and I apologize. I'll catch you up by saying that in June 2009 I took a contract position as a VMware Engineer over at CARQUEST Technology and it has been enjoyable thus far. That being said I'm hoping to get a few more posts over the coming weeks on vSphere and other technologies I am working with, such as the IBM XIV storage system.

Earlier today I logged into my vCenter 4 server to import the vSphere Management Assistant (vMA). I typed the web address... "www.vmware.com/go/importvma/vma4.ovf" and received the following error:
"An error occurred while reading the URL: Invalid URI: the format of the URI could not be determined."

To be fair I did not type in http:// as listed on the vMA site but it was disappointing to me that with all the investment that they put into making vSphere fantastic they failed to inlude a simple "IF" statement to check what the inputted string started with and add an HTTP:// if needed.

I then corrected my "error" and included the http:// and received yet another error:
"An error occurred while reading the URL: The remote server returned an error: (407) Proxy Authentication Required."

I am now 0-2 on trying to quickly add an appliance. A quick Google and VMware community search led to only one way to work around this by running the ovftool in the command line

ovftool --proxy=user:pass@proxy.example.com http://external-site.com/ovf/package.ovf

--P.22 of http://www.vmware.com/support/developer/ovf/ovf10/ovftool_10_userguide.pdf--

It seems to me that there should be some way to input the proxy settings either from the environment or through vCenter Server. I can see where there may be some disconnect since the ovftool is separate but this really makes it difficult for me to download appliances as easily as I should in order to best take advantage of OVF based appliances and the VMware Marketplace.

Browsing through the file system led me to a module.properties file under directory "C:\Program Files (x86)\VMware\Infrastructure\tomcat\webapps\ui\jslib-1.0.160852\modules\com.vmware.webaccess.ovf_1.0.0" in 64bit Server 2008 that contained tons of information but no presence of the word "proxy". Perhaps there is a line that can be injected on this or another settings file to eliminate the need to use command line ovftool in order to authenticate against our proxy server. I'll keep digging and update this post if I find another means to access appliances through our Proxy.


One last quick disappointing note: If you bookmark the vMA page you'll notice that the header has Assistant spelled incorrectly with an 'e' instead of the appropriate 'a'. I think in the end I'm disappointed that this appliance and mechanism for deployment isn't more polished like so many other VMware released items. In the end I've had to download the .zip to import the appliance. Not as slick and easy as it was intended to be.

Thursday, March 12, 2009

USB in ESX - How?

Since we brought it up and since I feel like a slacker for not posting in several weeks I thought I'd share my experience on managing USB devices in an ESX environment. In my previous post I mentioned a posting about connecting USB devices to ESX hosts and the many different ways for doing that in both a temporary and permanent fashion. I've never had much need for temporary connection but for a rock solid permanent solution I highly recommend AnywhereUSB by Digi - website.

Priced at just a couple of hundred dollars you are able to assign one of these an IP (or DHCP which I don't recommend), install the supplied software on your guest VM, plug in your USB device and you're up and running. Ok, so in all honesty here are some gotchas and other things to keep in mind:

1. One AnywhereUSB device to one operating system at a time. You can mix and match between physical and virtual as long as they have the provided client and drivers but only one server can talk to one of these guys at a time. This also means that even though it has 5 USB ports in it you can not map them to individual servers. Hopefully someone from Digi will correct me on this but that's just the way it is.

2. Give it a static IP. It makes it so much easier to track it down and to keep track of which one is which. If you purchase multiples of these you had better label the unit as well. You'll thank me for this one.

3. Follow the instructions for installation. I know you're gitty to have this device but if you skip a step you'll be sorry. Refer to #5.

4. Just because you have a gigabit network, you're limited to the speed of the AnywhereUSB device. I vaguely recall seeing that you may get USB2 speeds of 400mbps but I have not seen that as the case in production. If you have a 100Mb network then you know what your cap is already regardless.

5. Make sure you load the Windows generic drivers on your guest VM. ESX does not present USB to the VM, and you're not adding it to your VM's settings unless you've been doing some unsupported hacking, so the generic drivers were not installed when your OS was installed. In order to do this you'll need to copy the usbd.sy_ file from the \I386 directory of the Windows CD to the \system32\drivers directory and CHANGE THE FILE EXTENSION to usbd.sys. Reboot and then install the software. If you miss this step you'll be sorry.

6. I found it quite refreshing the first time I installed one of these guys and had the presence of mind to try it out first on a test server a snapshot before taking the first step. Always a good practice when installing something new for the first time.

7. You have to reboot at least once to use an AnywhereUSB device. That should be all though. Refer to #5

If you've kept these things in mind and follow the instructions you'll have many happy years of giving your VMs access to critical USB devices without unsupported hacking or sacrificing VMotion.


Links
Original Post - VMETC.Com
http://vmetc.com/2009/03/11/connecting-a-usb-device-to-an-esx-hosted-vm/

Digi - AnywhereUSB Website
http://www.digi.com/pdf/wp_ESXServer_AnywhereUSB.pdf

USB in ESX - Why Not?

I was recently talking with a friend about the beauty of USB devices in Workstation and we quickly began talking about the difficulties of USB devices in ESX. This is a problem I had already tackled some years ago with AnywhereUSB but earlier this evening I found a post discussing USB connectivity to an ESX hosted VM and felt it time to talk about it with you.

http://vmetc.com/2009/03/11/connecting-a-usb-device-to-an-esx-hosted-vm/

In the post the author describes several means for connecting USB devices in both temporary and permanent scenarios. I personally have never had much need for one time connectivity but since many of our applications require USB dongles for their license managers it's safe to say that connecting through the host or through RDP just won't do as a permanent solution. This is especially true as virtualization continues to branch out into the desktop arena where USB devices are more than just a pretty face, they're often a non-negotiable requirement.

While the post was extremely helpful one of the items that I feel the author failed to discuss is why VMware would continue to not support USB connectivity to guest VMs from their ESX hosts. Why wouldn't they indeed?

My immediate belief is that like most things it is for our own protection. Just imagine how upset your management, or you if you are the management, would be if DRS did not properly balance your resources, HA did not restart your server upon a failure, or you were not able to put a machine into maintenance mode due to a USB device preventing Vmotion because of a device associated to a single host. I know I wouldn't want to tell the boss that the thousands of dollars I fought hard for to purchase these features were all done in because of a USB dongle. Note: I have not yet tested this scenario but it seems reasonable given the results I've seen from having VMDKs and ISOs on local storage.

The greatest strength of VMware over its competitors is that they control the hardware and control the drivers that the VMs see. They have worked hard on their hypervisor to make these features available and I'm pretty sure that they won't open their arms to USB devices on the host anytime soon. After all, there are clearly many different options out there that solve this issue. Where's the benefit in complicating their already growing datacenter OS further?