Virtual Wood Blog

VMware, vSphere, ESX, ESXi, PowerCLi and everything else

Virtual Wood Blog - VMware, vSphere, ESX, ESXi, PowerCLi and everything else

How to reverse engineer IOPS

In a situation where the IOPS cannot be gathered from the physical SAN storage due to either limitations or access. The IOPS is required to see if the current solution will run the workload once it has been virtualised and if the hardware it will end up living on has the capacity.

The calculation is (MBps / Block size) * 1024.

To use the calculation the block size of the SAN needs to be understood and in the following it is assumed that a 64k block size has been used.

So… We have run PerfMon for 24 hours over the weekend and the same in the week. This is against the virtual machine or physical that is to be moved. I this case it is a SQL servers to give us the peak data throughput. Using PerfMon will allow us to see the average and peak.

The findings are listed below:

  • Physical – Read 282 MBps
  • Physical– Write 175 MBps
  • Virtual – Read 495 MBps
  • Virtual – Write 326 MBps

From these I can work out the I/O

  • Physical – Read (282 / 64) * 1024 = 4512
  • Physical – Write (175 / 64) * 1024 = 2800
  • Virtual – Read (495 / 64) *1024 = 7943
  • Virtual – Write (326 / 64) * 1024 = 5216

Now, with the virtual server it is known to have some caching that is involved, and that the actual data being written to the disk is 2900 IOPS Read and 1600 Write (Reported from the SAN console).

Which roughly translates to 36% of the 7943 is actual disk I/O and 64% is cached for reads and 31% is actual disk I/O and 69% is cached for writes.

Taking these numbers, I can apply the same percentages to the physical server

Reads total being 4512 IOPS, these are then broken down into 1624 IOPS actual disk I/O and 2888 IOPS cached. Writes total being 2800 IOPS, broken down to 868 IOPS actual disk I/O and 1932 IOPS cached.

Physical server would need 2492 total IOPS

I hope this helps people out when you are not able to run any other tool to gather the data required.

By Paul Wood

How to remove – host currently has no management network redundancy

During times when a LAB is being used with limited resources it is not always possible to have 2 network cards on the ‘Management’ vSwitch. This is not an issue during LAB or test and dev but will always produce ‘host currently has no management network redundancy’ which just makes the display look messy. This can be resolved with the addition of an extra Advanced Option for HA.

The following explains how the error can be removed but please this is only to be used when not in a production environment which should always have a redundant ‘Management’ vSwitch.

Right click on the cluster to be modified
Select Edit Settings
Click on vSphere HA
At the bottom right hand corner click on Advanced Options
Copy the following das.ignoreRedundantNetWarning and paste it under Options with a Value of True
Click Ok
Select Cluster Features
Uncheck Turn On vSphere HA and click OK

Note: This will turn off HA on the cluster but this needs to happen for the Advanced Feature to take effect

Right click on the cluster to be modified
Select Edit Settings
Click on vSphere HA
Check Turn On vSphere HA and click OK

Note: This will turn on HA for the cluster and the error regards ‘host currently has no management network redundancy’ will be gone

By Paul Wood

Opening PowerCLi fails Updated

Updated from the previous post

I run Windows 7 x64 and the issue I had is when installing the latest PowerCLi the command box flashes on the screen and then disappears. It seems the issue is related to the target line in the shortcut that is used to launch PowerCLi.

Below is the original line from the installation shortcut with the bold being what causes the issue:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -psc “C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1″ -noe -c “. \”C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\”"

Below is what the line should be changed to again with the text in bold that has been change:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noe -c “Add-PSSnapin VMware.VimAutomation.Core; . \”C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1\”"

In the above please make sure to replace ” once copied or it will not work

Once the line has been changed PowerCLi will launch and open without issue. All that is needed then is to set the signed scripts to run which is done by running the following command at the prompt:

set-executionpolicy remotesigned

Select ‘yes’ and type exit

Open PowerCLi again and you will be prompted with a fully functioning PowerCLi installation to start working with.

By Paul Wood

ESX 4.1 install error on BL460c G7 – NIC driver fails to load

This is a very useful blog that has come from www.vi-tips.com and I have posted it below.

The HP BL460c G7 is on the VMware HCL list for ESX 4.1. However, when trying to install ESX 4.1 there’s an error during install – it fails to load drivers for the network adapter ("No network adapters were detected"). It doesn’t help to update all firmware to latest version (even though this should be done in any case…) (Update 2011.02.18: This problem persists on ESX 4.1 U1)

This is a known error and there’s a fix for it. However, it seems strange that the G7 blade has made it to the HCL list…
The problem is that the Integrated NC553i Dual Port FlexFabric 10Gb NIC driver is not included in VMware’s installation ISO for ESX 4.1. There are two ways to solve the issue. One is to load a custom set of drivers for the NIC and the other is to use an HP VMware install image. If you’re using ESXi or scripted installation of ESX classic, then you have to use the HP image.
Custom NIC driver from VMware can be dowloaded here.
(Update 2011.02.18: Apparently, the NIC drivers are updated quite frequently at the moment. Go to this main link and then ‘plus out’ Driver CDs to find the most recent one.
HP image for ESX(i) can be downloaded from here.
The custom driver, when downloaded, is in an ISO format. To load it during installation, do the following:
  • Upload the ISO file to where you have the ESX installation image
  • On the Custom Drivers page in the wizard, choose Yes and click on Add. It will tell you to load the driver CD (see picture below)
  • Unmount the ESX installation CD and mount the driver ISO in stead. This can be done without interrupting the installation. You will be prompted to verify the custom driver package, click OK (see picture below)
  • That’s it. at a later stage in the wizzard, you will be prompted to reinsert the installation ISO. Do that when prompted.

 

By Paul Wood

Running nested virtual machines

In this blog I will explain what changes are need to allow a nested virtual machine to be powered on inside a virtual ESX host. This is something that I have been using to allow for study of the VCAP in a limited LAB situation.

The setup I have is physical ESXi 4.1 hosts on which I made a datacenter and cluster for LAB use. Inside this cluster I built 3 ESXi 4.1 hosts which have to be configured with the following disk configuration and OS selection:

  • LSI Logic SAS
  • Red Hat Enterprise Linux 6 (64bit)

Once the ESXi 4.1 hosts are built and everything else is configured the vmx file of each host needs to be edited. This will enable the virtual hosts to run virtual machines in the future. The lines that need to be added are as follows (I just added these lines to the end of the vmx file):

  • monitor_control.restrict_backdoor = "true"
  • monitor_control.vt32 = "true"

To add the above lines to the vmx file will require the file to be downloaded from the datastore and edited (for this I use Notepad++). The edited files are then uploaded back to the datastore (for good measure I remove the virtual machine and add it again to the inventory).

These additions will mean that nested virtual machines are now able to power on and the environment function like a physical one.

By Paul Wood

Changing the ip address of the vMA

During the initial setup on first boot of the vMA the configuration screen will ask questions regarding to ip address and hostname. If during this process an error has been made it is possible run the initial setup again.

I had this very issue as by mistake I selected "yes" to using DHCP. I spent some time looking at conf files but then found a reply on the VMWare forums that had the answer.

Go to the console screen of the vMA which will if it has just restarted prompting for a password to be set. Once this is complete follow the steps listed below:

  1. Press Alt F2 to get to the login screen
  2. Login using vi-admin
  3. Type cd /opt/vmware/vma/bin
  4. Type sudo ./vmware-vma-netconf.pl

This will come up with some rather comical text and the vi-admin password will need to be entered again. Once this has been entered the initial setup will run again allowing for any errors to be corrected.

By Paul Wood

Running vMA 4.1 on VMware Workstation

I came across this issue as I run my LAB as stated before on a laptop which means I cannot run x64 virtual machines on my ESX installations. After a quick search I came across a post by Kenneth van Ditmarsch which took me through the exact problem and below is the fix that I have tried and tested.

I have edited the two lines that need to be changed due to the "" that had been used. If the original version had been copied and pasted then the file would not work and the virtual machine fail.

After importing the new vSphere Management Assistant (vMA) 4.1 on my VMware Workstation 7 environment I noticed that it the virtual machine boots with a memory crash error. The error is “unable to access resume device” message and eventually ends with a kernel panic screen shown below.

The memory crash error can be ignored after checking CentOS blogs. The reason why the vMA virtual machine is hanging is due to the fact that its SCSI card and OS type needs to be changed in the .vmx file

Follow the steps below (credits to Justin for pointing this out to me!)

  • Remove the vMA from the VMware Workstation Inventory
  • Open the .vmx file and change the following to lines to be:

    scsi0.virtualDev = "lsilogic"
    guestOS = "rhel5-64"

  • Add the vMA back to VMware Workstation and boot it up.

Once the vMA has booted succesfully the configuration screen will be see. At this point follow vSphere Management Assistant Guide which will advise on how the vMA should be setup.

By Paul Wood

Configure a LAB with simple PowerCLi commands Part 2

This blog will carry on from part 1 adding more simple functionality to the LAB being created.

The LAB has not changed since part 1 so I will not list the contents again. Please refer back to part 1 for this information.

The following will be added to the LAB in this blog:

  • NTP servers
  • Configure the 1st vSwitch by adding another vmnic
  • Create a 2nd vSwitch with vmnic added
  • Move the ‘VM Network’ portgroup from vSwitch0 to 1
  • Setup a vMotion portgroup using a csv file

To start with we will configure a couple of NTP servers (No need to change the firewall on ESXi).

I will assume that a connection to the VC through PowerCLi has been established.

Please follow the simple instructions below:

  1. Adding NTP servers to the LAB and then restarting the service:
#
#adds two ntp servers and then restarts the ntpd service
#
Add-VmHostNtpServer -NtpServer "ntp1.sandvika.net" -VMHost (Get-VMHost) -Confirm:$false
Add-VmHostNtpServer -NtpServer "ntp2d.mcc.ac.uk" -VMHost (Get-VMHost) -Confirm:$false
$ntpd = Get-VMHostService -VMHost (Get-VMHost) | where {$_.Key -eq 'ntpd'}
Restart-VMHostService $ntpd -Confirm:$false
  1. At present the two hosts that are connected in the LAB only have 1 vmnic (0) attached to vSwitch0. This means that the management vSwitch has no resilience which is of course bad. I will now show the code for adding a 2nd vmnic to this vSwitch. The first example will add the 2nd vmnic to one host and the next code will configure all the host’s the same.
#
#configures a single host vSwitch0 to have two vmnic for resilience
#
$vswitch = Get-VirtualSwitch -VMHost labnode1.lab.local -Name vSwitch0
Set-VirtualSwitch -VirtualSwitch $vswitch -Nic vmnic0, vmnic2 -Confirm:$false

Note: In the above code a single host is being interrogated and only the vSwitch called vSwitch0 is being checked. It is better to specify using –Name

#
#configures all hosts' vSwithc0 to have two vmnic for resilience
#
$hosts = Get-VMHost
$name = $hosts
Foreach ($name in $hosts)
{
$vswitch = Get-VirtualSwitch -VMHost $name -Name vSwitch0
Set-VirtualSwitch -VirtualSwitch $vswitch -Nic vmnic0, vmnic2 -Confirm:$false
}

Note In the above code I have made the code work for us. It is now reading in all the host and then passing this on to an ‘Foreach’ statement so changing all the host’s in a few lines.

  1. We will now configure a 2nd vSwitch with 4 vmnic. This will then be used for the ‘VM Network’. This will of course need to be moved from vSwitch0. The following scripts will add a new vSwitch (1) and then the following script will remove the ‘VM Network’ portgroup from vSwitch0 and create a new one on vSwitch1.
#
#creates a new switch called vSwitch1 and then adds 4 vmnic for all host's
#
$hosts = Get-VMHost
$name = $hosts
Foreach ($name in $hosts)
{
New-VirtualSwitch -VMHost $name -Name vSwitch1
$vswitch = Get-VirtualSwitch -VMHost $name -Name vSwitch1
Set-VirtualSwitch -VirtualSwitch $vswitch -Nic vmnic1, vmnic3, vmnic4, vmnic5 -Confirm:$false
}
  1. We will now remove and then create the ‘VM Network’ portgroup from vSwitch0 to vSwitch1. This will leave the management network free of virtual machine traffic.
#
#removes the 'VM Network' portgroup then creates a new one on a different switch
#
$hosts = Get-VMHost
$name = $hosts
Foreach ($name in $hosts)
{
$vswitch = Get-VirtualSwitch -VMHost $name -Name vSwitch1
$pg = Get-VirtualPortgroup -VMHost $name -Name 'VM Network'
Remove-VirtualPortgroup -VirtualPortgroup $pg -Confirm:$false
$nvmpg =  New-VirtualPortGroup -VirtualSwitch $vswitch -Name 'VM Network'
}
  1. Next we will setup a vMotion portgroup on vSwitch0 for all hosts using a csv file. Thanks has to be given to the following post which helped me get the idea for using the csv file the end product is very different. The csv file needs to be populated with the relevant information for the LAB that is being worked on. This includes the location of the csv file that will be used.
#
#for all hosts this script reads a csv file for vMotion information. This information is then used to add a vMotion portgroup to vSwitch0 adding ip, subnet and then enabling. Once that is complete the gateway is also added
#The location of the .CSV file. This can be local or on a share
#
$getinfo = Import-Csv <a href="file://\\server\share\information.csv">\\server\share\information.csv</a>
$getinfo | % {
$Type = $_.Type #!!!! Case Sensitive  !!!!!!
$gethost = Get-VMHost -Name $_.HostName
$name = $gethosts
$PortGroup = $_.PortGroupName
$IP = $_.IP
$Subnet = $_.Subnet
$kernelGW = $_.KernelGW

#Creates vMotion switch and configures vmkernel gateway (located under DNS and Routing in configuration tab)
Foreach ($name in $gethost) {
IF ($Type -eq "vMotion") {

$vswitch = Get-VirtualSwitch -VMHost $name -Name vSwitch0
$vmotion = New-VirtualPortGroup -VirtualSwitch $vswitch -Name $PortGroup
New-VMHostNetworkAdapter -VMHost $name -PortGroup $PortGroup -VirtualSwitch $vswitch -IP $IP -SubnetMask $subnet -VMotionEnabled: $true

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

This is all for now and I hope it has helped understand in simple examples how powerful PowerCLi is to anyone who needs to manage many hosts. I will cover in the next blog how to add storage amongst other things.

By Paul Wood

Opening PowerCLi fails

Updated

I run Windows 7 x64 and the issue I had is when installing the latest PowerCLi the command box flashes on the screen and then disappears. It seems the issue is related to the target line in the shortcut that is used to launch PowerCLi.

Below is the original line from the installation shortcut with the bold being what causes the issue:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -psc “C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1″ -noe -c “. \”C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-VIToolkitEnvironment.ps1\”"

Below is what the line should be changed to again with the text in bold that has been change:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noe -c “Add-PSSnapin VMware.VimAutomation.Core; . \”C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1\”"

Once the line has been changed PowerCLi will launch and open without issue. All that is needed then is to set the signed scripts to run which is done by running the following command at the prompt:

set-executionpolicy remotesigned

Select ‘yes’ and type exit

Open PowerCLi again and you will be prompted with a fully functioning PowerCLi installation to start working with.

By Paul Wood