VMware education services has put together some awesome video’s for all to watch. Check them out here:
Random thoughts and technical bits
VMware education services has put together some awesome video’s for all to watch. Check them out here:
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:
Followed up by this error:
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
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.
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)
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/
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.
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:
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.
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.
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.
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.
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.
Now that your have your vcenter appliance and update manager updated your all ready to update hosts. Here is the process:
Attach the new upgrade baseline and scan hosts
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.
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)
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:
A few tips on the exam:
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
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.
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
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:
I will use the terms source VCSA 5.1 and destination VCSA 5.5.
Then you should be upgraded. You can read more about the process here: