Issues with Upgrading Virtual Hardware to 10 (Compatibility mode 5.5)

When you upgrade your vsphere and esxi versions you have a vmware tools and hardware version upgrade.  Version 10 is called Compatibility mode 5.5 (good name change)  does continue to force you on to the web client.   If you upgrade to 10/5.5 you will be unable to edit virtual machine settings in the fat C# client.   It does warn you but if your like me you just clicked right on through:

 

1

 

Followed up by this error:

2

 

So you have been warned get used to that web client.

 

Just for people new to the process you can revert the hardware version with a snapshot so take one first.

Enjoy,

J

Partition Alignment and block size VMware 5

This post spawned from a question in the official VMware forums and got me thinking about this problem.  For years I have manually adjusted by partition alignment on my linux machines to get that little bit of improvement from the disk.  So the question was with so many layers (physical array, array raid, VMFS, Guest OS) what is the best practice around alignment and block size.

VMFS 5 facts

First lets start with some facts around VMFS version 5 (this assumes they are new lun’s in vmfs 5 not upgraded luns.  Upgraded lun’s retain their original block size)

  • Unified 1MB block file size (only present on new lun’s upgraded lun’s retail their 4.xx block size)
    • Supports very small files (<1KB) by storing them in the metadata rather than in the file blocks.
    • Uses sub-blocks of 8K rather than 64K, which reduces the space used by small files.
  • Partition table has been changed from MBR to GPT – which allows files larger than 2TB (remember that the max size for a single drive presented to a guest is locked at 2TB-512Bytes until 5.5 which allows 60TB’s to be presented to guests)
    • Upgrade does change the part table but only if the lun is over 2TB
  • Increased file count VMFS-5 allows for 100,000 files

You can check the current settings of your lun (figure out block size etc..)  via the following command:

vmkfstools -Pv 10 /vmfs/volumes/newly-created-vmfs5/

 

What is the deal with alignment:

Sectors on the disk

I will skip the legacy history lesson but the simple answer is hard drives are divided up into sectors using a method called Logical Block addressing (LBA).  LBA assigned the carved up disk sector numbers which are used to address specific locations.  The original size of a sector is 512 byte in size but there has been a big movement toward 4096 byte sectors.  The larger sector size provides some great efficiency but due to backward’s compatibility most storage will allow for 512 byte read’s / writes emulated which actually use 4096.

RAID on the disks

So now we have  disk cut into 4096 bytes and we want to give it some redundancy so we stripe / mirror data across multiple disks.   So on top of our 4096 byes we put data format carved into increments of 4KB to 256KB’s depending on the the array.  Now since all options should be in increments of 4KB’s we will not need half a sector to do a read.  See the diagram below for the correct alignment:

Untitled

Now if you raid set used an alignment of 13KB this would cause all kinds of problems.  The read/writes would cross sectors and carve them up into all kinds of messes.

Untitled

So the good news is your storage vendors know this and make sure their raid size is an increment of 4KB to avoid this.  What size does your array you use?  Completely up to your storage vendor.  You need to ask them.

VMFS Again

So how does vmfs handle alignment well it’s simple it used 1MB alignment size. so now we are up from 4KB – disk to 4KB – 256KB Raid to 1MB for VMFS.   There is another portion to this story disk alignment.   I will cover disk alignment more in the Guest OS section at this point just know that VMFS takes care of the issue.

Guest OS

Now we are really having fun.  The fine people who created your operating system needed some space at the front of every drive to hold partition information.  In their wisdom they used 62 bytes leaving 1 byte free and thus creating a mis-alignment with the 4KB sectors.  This alignment will create cross boundry read/writes as seen on the raid section.   So you need to offset your parition to start at a logical 4KB boundry like 63.  Failure to do this can cause problems.  In addition what block size should you use on your OS.  Well if given the choice you do not want to go smaller than 1MB since that’s the size VMFS uses.  You also want to make sure it’s divisable by 4KB.  So what should you use?  Really up to you and your operating system.  On Linux I normally use 4MB block sizes.  Windows does this on it’s own and aligns correctly.

What is the big deal?  How much do I really gain through all this math?

Not a whole lot really but it’s worth building your templates with these boundaries in mind.  Remember that all these things apply to physical machine best practices minus the 1MB VMFS size.  It’s a best practice and remember that with virtual machines it’s hundreds of mis-reads / writes and contention for the same sectors which can really add up.

Upgrade / update ESXi from 5.1 to 5.5

Now that your have your vcenter appliance and update manager updated your all ready to update hosts.  Here is the process:

  • Download the ESXi 5.5 ISO
  • Log into vcenter fat client
  • Home -> Update Manager
  • ESXi Images -> Import ESXi Image
  • As part of import you can create a baseline called something like ESXi 5.5 Upgrade.
  • Hosts and Clusters -> Select cluster and Update Manager
  •  

    Attach the new upgrade baseline and scan hosts

  • Then remediation to apply 5.5
  • Login to console of ESXi to reboot it after upgrade (on mine it required a reboot first before it would upgrade so you may have to reboot twice)
  • Reconnect in vcenter
  • Scan for update
  • License Server again
  • Exit Maint mode and you have a 5.5 ESXi host

Create a ISO datastore with CentOS

Morning,

This came up in a discussion in the vmware forums and I figured I would put it all down.  The user wanted to be able to have his ISO’s for VMware and Windows shared and wanted to know how to do it from Vmware.  Well it’s not possible from VMware because it cannot be a NFS server to share out VMFS.  But VMware does support NFS storage so with CentOS (RedHat / OracleLinux it will work the same) you can create a shared NFS mount that can also be mounted via CIFS to Windows.

So I am going to Assume you know how to install Linux if not download and click next…next…next. Once installed login as root and make sure you have networking.

Install and lock down NFS

Code:

yum install nfs -y

Secure the install of NFS:

add the following to /etc/hosts.deny (Will block everyone access to NFS services)

portmap: ALL
lockd: ALL
statd: ALL
mountd: ALL
rquotad: ALL

Add hosts that are allowed to connect to NFS to /etc/hosts.allow each Ip with an or

portmap: 10.10.101.10 or 10.10.101.11
lockd: 10.10.101.10 or 10.10.101.11
statd: 10.10.101.10 or 10.10.101.11
mountd: 10.10.101.10 or 10.10.101.11
rquotad: 10.10.101.10 or 10.10.101.11

The exported file system is the file system you want to share out we will use /nfs/ISO in this example it can be anything.  I would make it a different partition and potentially LVM but that’s out of scope.  Edit /etc/exports and add the servers you want to be able to mount /nfs/ISO notice I made 10.10.101.11 read only (ro) and 10.10.101.10 read write (rw)

# Sample
/nfs/ISO 10.10.101.10(rw,no_root_squash)
/nfs/ISO 10.10.101.11(ro,no_root_squash)

Now we need to lock down NFS to specific ports to make it more firewall friendly.   Edit /etc/sysconfig/nfs and add the following lines (make sure to comment out these lines if already in use)

STATD_PORT=4000
LOCKD_TCPPORT=4001
LOCKD_UDPPORT=4001
MOUNTD_PORT=4002
RQUOTAD_PORT=4003

Add the following to /etc/services and comment out original entries:

rquotad         4003/tcp                        # rquota
rquotad         4003/udp                        # rquota

Start NFS service and enable at boot time:

/etc/init.d/portmap start 
/etc/init.d/nfs start 
/etc/init.d/nfslock start 

chkconfig portmap on 
chkconfig nfs on 
chkconfig nfslock on

Now if your running a host based firewall you will want to open it remember we are controlling access via hosts.allow:

-A RH-Firewall-1-INPUT -p tcp -m multiport --dports 4000:4003 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m multiport --dports 4000:4003 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp --dport 2049 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 2049 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp --dport 111 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 111 -j ACCEPT

Now you need to setup and install SAMBA to share out the same file system via CIFS:

Lets start with the firewall rules and assume that our Windows servers are all on 192.168.10.0/24

-A RH-Firewall-1-INPUT -s 192.168.10.0/24 -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
-A RH-Firewall-1-INPUT -s 192.168.10.0/24 -m state --state NEW -m udp -p udp --dport 445 -j ACCEPT
-A RH-Firewall-1-INPUT -s 192.168.10.0/24 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -s 192.168.10.0/24 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A RH-Firewall-1-INPUT -s 192.168.10.0/24 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT

Install Samba and required componets:

yum install samba samba-client samba-common

Turn it on at boot time

chkconfig smb on
chkconfig nmb on

Edit the file /etc/samba/smb.conf and add your info to the config file including workgroup… yes it’s possible to add Samba to a domain I will not cover it here

#======================= Global Settings =====================================
[global]
 workgroup = WORKGROUP
 security = share
 map to guest = bad user
#============================ Share Definitions ==============================
[ISO]
 path = /nfs/ISO
 browsable =yes
 writable = yes
 guest ok = yes
 read only = no

Restart samba services to reload the changed config

sudo service smb restart
sudo service nmb restart

Browse to the machine for something in 192.168.10.0/24 and you should see the share and be able to write to it.

Please let me know if you have any questions and enjoy your ISO share (yes it can be a virtual machine)

VCAP5-DCD Exam Study Guide / Results

Well yesterday I took the VCAP5-DCD test again and passed it this time.  I was very happy.  I failed it the first time because I was mostly worried about time.  This test unlike most of the rest does not allow you to go back so once you finish a question your done.  This was a challenge.  The second time I was prepared and ended with 30 minutes to spare.   I found the VCAP5-DCA test to be a lot of fun.  This was not true with the DCD.  I only do about 2 or 3 designs a year while I do administration every day.   So it was not as familar to me.   Here are some things to help you:

Study Guides I used:

  • The official guide book here.
  • The awesome vSphere 5 clustering deep dive here. notice I liked the version 5 since the test is based on this version not 5.1 (but you really should read the 5.1 version by far the best vsphere book around, the kindle version of 5 is free right now)
  • The VCAP5-DCD document bundle (All the documents referenced in the blue print which is important because there are newer versions of these documents but the test is on these.)
  • The design blueprint (Yes I read the whole thing and read the documents)
  • The design tool demo (The test uses a visio like tool demo’ed by vmware)
  • The unofficial study guide (yep you have used these before they guys rock)
  • Focus on the design elements and best practices around configuration (storage, compute, etc..)

A few tips on the exam:

  • The test is graded right away so no human is looking at your design making it pretty is not important missing connections or requirements is critical.
  • Make sure when using the design tool that you connect directly to the objects once connected try to drag the object around to make sure it’s connected.  These connections are critical for it to grade you I think.
  • It’s a long exam and you don’t get scheduled breaks so please take 5 minutes to take a break in the middle.
  • You might want to read the questions before you read the details it will help direct your attention to what is critical.

Well from here I’ll say good luck and take those tests.  This one was really good for me it got me thinking about design in a new way and added a lot to my skill set.

Thanks,

J

 

Vmware Hands on Labs

Do you want to play with vmware technology but don’t have a lab?  Problem solve project nee.  All the lab’s from VMworld 2013 are available for your use for free… and they are awesome.  Test out some awesome technology on vmware’s dime.  Anyone can register at :  http://www.projectnee.com/testdrive/

 

Give it a try.

 

PowerCLI: List how much storage thin provisioning is taking

Ever wonder how much storage is used by your thin provisioned luns?  Well here is some power shell to find out:

 

Thin provisioned allocation

 

# Define Variables
$outputFile = 'C:\VMDiskCapacity.csv'
$myCol = @()    # Prepare output collection
$VMs = Get-VM | sort Name    # Get all VMs (sorted)
$counter = 0    # Initialize counter for progress bar
ForEach ($VM in $VMs)    # Loop through VMs
   {
   $counter++    # Increase counter for progress bar
   Write-Progress -Activity "Gathering disk information" -Status "Processing VM $VM" -PercentComplete (100*($counter/$VMs.count))    #
   $myObj = "" |
   select VM, TotalDiskSizeGB # Create output object
   $myObj.VM = $VM.Name    # Virtual Machine Name

   $TotalDiskSizeKB = 0
   ForEach ($DISK in $VM.HardDisks)
      {
      $TotalDiskSizeKB += $DISK.CapacityKB
      }

   $myObj.TotalDiskSizeGB = [math]::Round(($TotalDiskSizeKB * 1KB / 1GB),0) #Disk Size in GB
   $myCol += $myObj    # Add output to collection
   }
$myCol | Export-Csv $outputFile -NoTypeInformation  # Export output to csv

 

Upgrade vCenter Appliance VCSA FROM 5.1 to 5.5

With 5.5 released and lots of people using the vCenter Appliance (VCSA) I figured I would write a visual guide to upgrading the appliance.  vCenter is always the first step in the upgrade.  I will be showing the steps to upgrade from 5.1 to 5.5.

The upgrade process is as follows:

  1. Deploy the new VCSA from the OVF with a new IP that can talk to your old VCSA
  2. Import keys that allow them to talk to each other
  3. Input some new information
  4. Data is transfered from the old VCSA to the new one
  5. New VCSA takes over the ip of the original VCSA
  6. Old VCSA is left powered off

I will use the terms source VCSA 5.1 and destination VCSA 5.5.

  • Snapshot the source for recovery purposes
  • Login to source vcenter via https://vcenter_ip:548
  • VCSA 5840

 

 

  • Deploy the new version of the vcenter appliance from the OVF with a IP address that can talk to the old appliance (we will call this the destination appliance)
  • Untitled
  • Power on the appliance
  • Login to new appliance with https://destination_vcenter_ip:5480 and login via u: root p:vmware
  • Accept the EULA
  • Select Upgrade from Previous version
  • Untitled
  • It will provide a key that needs to be cut and pasted into the source machine
  • Cut and paste key from destination appliance:
  • Untitled
  • Import will take a while.  Once complete it will provide you a key to import into the destination machine:
  • Untitled
  • Next -> It may complain about the host names click ok. If asked to replace the certs say yes… unless you have custom certs in your environment.
  • 5.5 requires a new SSO password so you have to provide one on the destination machine
  • It will then try to bring in your hosts.  Confirm they look ok then next->
  • It will run some checks and let you know what it found.
  • Next to start the transfer -> It will ask if you snapshotted your old machine you should have
  • Then start the process it will take a while to run. During this process both machine will reboot and your new machine will end up with your old machines IP address and vcenter duties leaving the old one powered off.

Then you should be upgraded.  You can read more about the process here:

http://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.vsphere.upgrade.doc_50/GUID-6A5C596D-103E-4024-9353-5569263EB427.html#GUID-6A5C596D-103E-4024-9353-5569263EB427