Showing posts with label Virtual Center. Show all posts
Showing posts with label Virtual Center. Show all posts

Friday, January 2, 2009

A GUI for sVmotion

A couple of days ago, I downloaded and installed a VI Client plugin for Storage vMotion which makes utilizing Storage vMotion as easy as a standard vMotion migration. David Davis over at VirtualizationAdmin.com has written up a nice little guide on installing and using this plugin. It was written by Andrew Kutz and is provided free of charge on his Google Code page. The only gripe I have is that I was unable to use it to locate my vmdks and vmx files on separate SAN LUNs. I find this especially useful in the case of something like a database where I may want a vmdk on RAID 5 for my data files and a separate VMDK on RAID 10 for my transaction logs. If anyone knows of a slick GUI that supports this functionality, I'd appreciate the tip.

Wednesday, December 31, 2008

CPU Masking

Several months ago, I ended up in an unfortunate situation. We invested a sizeable amount of money on a powerhouse server to add to our ESX cluster. While the server was the same model as the rest of the machines in our cluster, the vendor had added SSSE3 support to this latest revision, something I was not aware of at the time of purchase. The end result of adding these new instructions to the cluster was vMotion incompatibility between this server and our other ESX hosts.

While not supported by VMWare, CPU masking is a feature available in Virtual Center that will allow you to overcome situations like this. While in my case, SSE3 servers to an SSSE3 server, compatibility certainly cannot be guaranteed in these situations and I must emphasize that you proceed with caution. In addition, if the differences in my CPU's were more profound (say AMD vs. Intel), I would never attempt this, especially in a production environment.

In some situations, Enhanced vMotion will allow you to overcome minor CPU differences and I would certainly recommend that as a first attempt. You will need to be running at least Virtual Center 2.5 Update 2 and ESX 3.5 Update 2 to enable this. You will also need to recreate your cluster. You can find information on EVC as well as supported processors in KB 1003212.

VMWare outlines the process of CPU masking in KB 1993. In my case, I wanted to mask only the needed instruction sets and it took a little while to figure out exactly which combination of masks to use between each of the registers leveraged. The end result was to navigate to C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter and edit the vpxd.cfg XML configuration file. The section of text below was all that was needed to accomodate the differences between these processors. Sorry for the screenshot, but formatting XML for web presentation is a pain...

Monday, November 10, 2008

How Virtual Center Calculates HA Failover Capacity

From the Resource Management Guide:

"HA plans for a worst‐case failure scenario. When computing required failover capacity, HA calculates the maximum memory and CPU reservations needed for any currently powered on virtual machine and calls this a slot.... HA determines how many slots can “fit” into each host based on the host’s CPU and memory capacity. HA then determines how many hosts could fail with the cluster still having at least as many slots as powered on virtual machines. This number is the current failover level."

What this means is, if I have one really powerful VM on my cluster (say 4vCPU and 4GB RAM reservation), VC will calculate ALL of my VMs as being this powerful when determining failover capacity, even if all of the other VMs are 1vCPU and have a low memory reservation. Since the calculated failover capacity will obviously be much lower than what I can actually run on, I opted for a workaround.

1) Set Admission Control to allow VMs to power on even if they violate availability constraints.

2) Create a non-expandable resource pool with unlimited access to resources. Set the reservations for CPU and memory to be the sum of all of your remaining hosts should your highest resource machine die. Take the following example:

ESX1 - 2 x 2.4GHz, 24GB RAM
ESX2 - 2 x 2.4GHz, 32GB RAM
ESX3 - 4 x 2.4GHz, 24GB RAM

My resource pool reservation would be set to 4 x 2.4GHz (my two lowest CPU producers) and 48GB RAM (my two lowest memory producers). Make sure to adjust these numbers down to allow overhead for the host.

3) Make sure to add all VM's to this resource pool and keep your reservations up to date.

Monday, November 3, 2008

Virtual Center Performance Reporting

While Virtual Center provides a great performance monitoring interface to gain some insight into VM resource consumption, I wanted a way to automatically get a run down of my VM's memory and CPU utilization e-mailed to me on a weekly basis. This is especially useful when setting resource pool reservations. If you would like to do the same for your VC database, you'll need to set up database mail on your SQL server and create a SQL Server Agent job to run each of the following scripts. Set up a schedule and you're on your way!

Script 1: Memory Utilization

EXEC msdb.dbo.sp_send_dbmail@recipients = 'yourname@yourdomain.com', @subject = 'Virtual Center Memory Utilization Report',@body_format = 'HTML',@body = 'Here are some memory utilization metrics for the last month.',@query = ' USE VirtualCenter select vms.NAME as ''VIRTUAL_MACHINE'' , (AVG(STAT_VALUE)/10000) as ''MEMORY_PERCENT''
into #STAT_REPORT_TEMPfrom dbo.VPXV_HIST_STAT_YEARLY
JOIN VPXV_VMS vmsON SUBSTRING([ENTITY] ,4 , 4) = vms.VMID
where stat_group = ''mem''and entity like ''vm%''and sample_time > (getdate() - 30)
group by vms.NAME
go
select VIRTUAL_MACHINE as ''Virtual Machine'' , MEMORY_PERCENT * vm.MEM_SIZE_MB as ''Memory Usage in MB''
from #STAT_REPORT_TEMP stat
JOIN VPXV_VMS vmsON VIRTUAL_MACHINE = vms.NAME
JOIN VPX_VM vmON vms.VMID = vm.ID
ORDER BY VIRTUAL_MACHINE
go
drop table #STAT_REPORT_TEMP',@attach_query_result_as_file = 1,@query_attachment_filename = 'Virtual Machine Memory Stats.xls'


Script 2: CPU Utilization

EXEC msdb.dbo.sp_send_dbmail@recipients = 'yourname@yourdomain.com', @subject = 'Virtual Center CPU Utilization Report',@body_format = 'HTML',@body = 'Here are some CPU utilization metrics for the last month.',@query = ' USE VirtualCenter select vms.NAME as ''VIRTUAL_MACHINE'' , (AVG(STAT_VALUE)) as ''CPU_USAGE''
from dbo.VPXV_HIST_STAT_YEARLY
JOIN VPXV_VMS vmsON SUBSTRING([ENTITY] ,4 , 4) = vms.VMID
where STAT_NAME = ''usagemhz''and entity like ''vm%''and sample_time > (getdate() - 30)
group by vms.NAMEorder by vms.NAME',@attach_query_result_as_file = 1,@query_attachment_filename = 'Virtual Machine CPU Stats.xls'


Each of these scripts takes an average for each metric over the last month but if you prefer, you could edit these to use a different time frame.