ESX3.x VC2.x ServiceConsole Guide
ESX3.x VC2.x ServiceConsole Guide
Table of Contents
Introduction .............................................................................................3 Module 1: Users and Rights ......................................................................6 Creating a New User ................................................................................. 6 Elevating yourself to ROOT ........................................................................ 6 Disabling Auditing on ROOT (Not Recommended) ......................................... 6 Miscellaneous User Managements Tasks ...................................................... 7 Module 2: Getting around & Getting help .................................................8 Module 3: File & Folder Management......................................................10 Module 4: Networking ............................................................................15 Viewing your Switches & Service Console Networking ................................. 15 Creating a vSwitch (Internal) ................................................................... 15 Creating a vSwitch (Single NIC) ............................................................... 16 Creating a vSwitch (Multiple NICs) ........................................................... 17 Deleting a Switch from vSwitch ................................................................ 18 Creating PortGroups for VLAN Networking NIC Team .................................. 19 Creating Vmkernel Switches .................................................................... 20 Changing your Service Console IP Settings ................................................ 22 Setting the Speed and Duplex of NICs ...................................................... 23 Recreating your vswif0 Interface .............................................................. 23 Removing a NIC from vSwitch.................................................................. 24 Deleting a PortGroup from vSwitch ........................................................... 24 Managing the ESX Firewall....................................................................... 24 Fixing ESX Networking after an Upgrade ................................................... 27 Typical vSwitch Errors ............................................................................. 29 Module 5: Configuring Physical Storage .................................................30 Configuring SAN Storage ......................................................................... 30 Configuring NAS Storage ......................................................................... 30 Connecting to iSCSI Storage (Software) .................................................... 31 Creating a VMFS Volume ......................................................................... 33 Changing the Volume Label ..................................................................... 35 Viewing VMFS Volumes/Partition Information ............................................. 36 Viewing Available Physical Disk Space ....................................................... 37 Mounting and U-mounting VMFSs ............................................................ 38 Managing Storage Devices....................................................................... 38 Using USB storage Devices ...................................................................... 39 Module 6: Managing Virtual Machines ....................................................43 Creating Virtual Disks ............................................................................. 43 Creating and Managing RDMs .................................................................. 44 Exporting & Importing Virtual Disks .......................................................... 46 Copying Files from one ESX host to another............................................... 48 Renaming Virtual Disks ........................................................................... 49 Resizing Virtual Disks.............................................................................. 50 Deleting Virtual Disks.............................................................................. 53 Using VMware-cmd ................................................................................. 53 Changing Parameters within a VM with /proc ............................................. 57 Module 7: Performance Monitoring ........................................................58 Using ESXTOP to Monitor Virtual Machines................................................. 58 Tools to Monitor the Service Console......................................................... 64 Module 8: Upgrading/Patching ESX........................................................65 Pre-Upgrade Checks ............................................................................... 65 Custom Upgrading with a Tar-Ball ............................................................ 65 Upgrading to VMFS-3 from the Service Console .......................................... 67
Introduction
Purpose of this guide This guide is designed for people who already know ESX 3.x and VC 2.x quite well. Although it starts as a beginners guide initially, it pretty rapidly starts to assume very good knowledge of the system. I would recommend you get to grips with the GUI first, and feel comfortable with Vi-3 before attempting this guide. That said you might be wanting to carry out a discrete procedure from the command-line. So feel free to dip in find what your looking for and then dip out again! It is not a comprehensive guide to ALL the commands just the primary ones. I hope to make this guide gradually more comprehensive, and cover all new commands that useful. Ive deliberately not covered every single esxcfg command because not all of them are terrifically useful There are some big topics that I have yet to add to this guide this includes setting NTP and Active Directory authentication for the Service Console Please email at the email address at the beginning of this document if spot any errors Where possible I dont use the VI Client. I only use the VI client if there is no other way even if the VI client is easier. The reasoning behind this force the use of the command-line. Perhaps I should state why using the command-line might be useful But I Automation of tasks? Er, because everything else is broken and login in at the ESX host at the Service Console is your only option Because sometimes its quicker (sometimes its quicker using the mouse too!) Because like Everest, it is there!
prefer the mouse? Then this guide isnt for you Choose File, and close But seriously, what are commands only words that carry out instructions Who in Windows hasnt used the net use or net servicename stop/start command? I grew up on DOS/Windows3.x/Novell a mix of GUI and commands. For which I am very grateful. I am happy in both environments. Although I do find myself swearing when commands refuse to work, but that said I also swear at Windows just as much perhaps like Pete from Big Brother have Tourettes Syndrome. God knows when ever I watch Big Brother I feel uncontrollable the urge/need/desire to shout wankers at the top of my voice Hopefully this guide will reduce the amount of swearing you do at computers. You must remember they cant hear or understand your profanities and talking to inanimate objects is usually the first stage of madness
Anyway, I digress - Ive noticed as the GUI grew to dominate our environments my command-line skills took a hit. If you dont use it, you loose it as the saying goes. I dont intend my skills to be eroded by a little mouse. Of course they could be equally eroded by the keyboard.
Hardware I use a 192.168.2.x range on my network with 192.168.2.101 for esx1, 192.168.2.102 for esx2. My DNS server is 192.168.2.200. All IPs here are just example from my network range replace with your own This guide assumes you have at least 2 servers with 2CPUs at 1.4mgz each 2GB of RAM 2x36GB Hard Drives (SCSI Internal) 4x Network Cards (production in a bond, vmotion and Service Console eth0) This is the specification of my server an old Dell 1650 PowerEdge using PIII processors! My hardware isnt officially supported by VMware anymore. Anyway it still runs. But at some point I am going to buy two DL380, and re-use this hardware as my VC box and a NAS box I have VC set-up with a SQL Database. The layout of my VC looks like this before the upgrade:
Two Servers, Two Virtual Machine Groups (for me and my mate, Trevor) The domain name is rtfm-ed.co.uk lavericm-admin is the VC Administrator set at Server Farms instructor is a Virtual Machine Admin from the RTFM Farm (used when I teach with my hardware) baverstockt is a Virtual Machine User with rights only for Trevors VMs Group Software In my case VC Server 2.x and SQL 2000 (SP3) all runs on Windows 2003 with Service Pack 1. This was the most current release of Windows at the time of writing this document Warning: As ever my documents are released as is and without warranty
Hardware & Software As we at the Service Console you dont really need to have exactly what I have but it would help to have what I have or better Conventions in this Guide I use PuTTy to get Service Console sessions I use nano rather than vi to edit and save files mainly because Im no Linux guru, and I find nano more user friendly. Vi text editor is popular in the Linux community because it pretty much standard amongst every Linux distribution. Dont let anyone make you feel an idiot or small because you use nano. As long as you can successful manage the system thats all that counts in my book. Linux people, do NOT flame me on the merits of using VI. I will absolute NOT respond!
IMPORTANT:
To have your command-line changes reflected in the VI Client you must restart the hostd service on the ESX host. You can do this by using service mgmt-vmware restart
clear su -
Display ESX Version Number Search Man pages by index Reboot ESX Server Shutdown Shutdown & Halt
vmware -v makewhatis man k partition Reboot shutdown now Server shutting down for maintenance shutdown h now server shutting down for maintenance
Should display information along this kind VMware ESX Server 2.5.0 build-11343 Creates an index of the man pages Searches manual pages for string of partition Reboots the server, does not ask are you sure are you really sure? Shuts down the VMs and stops remote access physical console is still accessible Shuts down the VMs; Stops Remote Access and does a fault halt of the system and volumes un-mounted
Delete contents of directory and all files and subdirectories Mount a CD at the Service Console Mount an ISO at the Service Console
Rm /root/vm-support.3630 r f
mount /dev/cdrom ls l /mnt/cdrom mkdir /mnt/isocd mount -o loop -t iso9660 -r /vmimages/esx3.iso /mnt/isocd
Here I am deleting the extracted contents of an untard vm-support script. r does a recursive delete of all files and folders within vmsupport.3630 without a prompt (-f) DANGEROUS COMMAND! Root only! Create directory for the mount point -o loop means mount the device as a block device -t iso9660 means its using the iso file system (as opposed to say Joliet) r means to mount read-only Be careful with the use of wildcards if you try to copy every file with *.* as you would with DOS/Windows this would miss out files that DID NOT have extension. So w2k3.iso would be copied but w2k3 would not This uses secure copy. You will prompted with some security warnings on the first copy for the first time. You will have manually type the password of the remote machine. Warning: You will need to enable firewall the SSH Client on the ESX where your files are located (source) but NOT where they are being copied to (destination) Move because effectively, any rename is move procedure. If you know the name of a file but cant remember where it is stored the whereis command is dead easy to use Find is much more powerful but can take longer based on your search criteria. Search here begins at the root / and is caseinsensitive search by using iname and *.conf would find every conf file note are required these are single quotes not double-quotes / is the search point, -mount volumes mounted, -mtime is the duration and print is the format for output to the screen This would find files off / taking up more than 10MG Works best with single files such a vmdk file Caution, automatically deletes original and adds a gz extension to
Copy a file
cp /vmimages/w2k3.iso /vmfs/volumes/nas_isos
find / -mount -mtime -1 -print find / -mount size +10240k gzip /vmfs/volumes/local-esx1-esx1/instructor/*.vmdk best
gunzip /vmfs/volumes/local-esx1-esx1/instructor/*.vmdk
Compress Multiple files Uncompress Multiple files Change Ownership Change Group Membership
the file name As above but in reverse! There is also a utility called bzip2 and bunzip2 which use newer algorithms which offer better compression ratios and better performance This would backup all the files in the vmimages directory to a backup folder (c create, z compress, v- verbosely listed files being tard, use a file) This would restore all the files in the vmimages directory to a backup (x Extract, z uncompress, v- verbosely listed files being tard, use a file)folder Change the Owner of instructor.dsk to be lavericm, also changes user group to be lavericm as well Change the Group rights to be the User Group, in this case lavericm
Change Permissions
Changing permissions on files shouldnt be needed very often as all files are created and owned by root (despite being created with VI Client with a Windows Logon) Change permissions on files using decimals to represent RWX. Used with the R switch it sets these permission recursively. 77 is short for RWX for the user and group, and 4 for R for others. Although the Numbers are expressed in decimal - they are effectively binary where 1 is Execute, 2 is Write and 4 is R. They are represented not unlike jumper settings on the back of a SCSI device so 000 would mean NOTHING 0 001 would mean X 1 010 would mean W 2 011 would mean WX 3 100 would mean R 4 101 would mean RX 5 110 would mean RW 6 111 would mean RWX 7 Sum is less good than md5sum. You need to compare copied file to known good original usually from a website Most frequently done to check integrity of downloads checkout WinMD5Sum if you have download to Windows VMDK are just extensions. During import/export process vmkfstools e or i does not rename. Head examines the contents of the file a report true format VMDK: standard input: x86 boot sector (Monolithic) VMDK: standard input: ASCII Text (Sparse or Metadata File) For older Vmware products look for COW in the printed string
To create a ISO file from mounted CD at the Service Console To List the last ten lines of a log file
tail /var/log/messages
Not recommended, as there is no check done on the integrity of the ISO file WinImage - http://www.winimage.com Tail can take parameters to show more or less information with long files like logs it can be easier to handle than cat
Module 4: Networking
Note: Networking involves the use of command esxcfg-vswitch, esxcfg-vswif0 and esxcfg-vmknic. These are quite involved commands used in a particular order to achieve the results your are looking for. So Ive decide to write more of a step-by-step guide than just a command-list with a brief explanation esxcfg-vswitch is the main command and it has a mix of parameter in lower and upper-case. Lower-case parameter manipulate the switch, where as upper-case switches manipulate the portgroup. So to add a switch its a and add a upper-case A adds a portgroup In one way this is nice but its incredibly easy to create a switch rather than portgroup attached to a switch and I have done this a few times
Note: This shows me I have one vSwitch (vSwitch0) using one NIC (vmnic0) with one portgroup called Service Console which is not using VLAN. 2. To view your Service Console network settings esxcfg-vswif l
Note: Nothing to state here but I think its interesting that it doesnt show me my all important default gateway settings which would have been nice 3. To View your network cards vmnic, pci (b:s:f), driver, link, speed, duplex and description: esxcfg-nics l
esxcfg-vswitch a vSwitch1 2. Then add a portgroup esxcfg-vswitch A internal vSwitch1 Note: Lower-case -a for adding a switch, and upper-case -A for adding a portgroup 3. If you run the command esxcfg-vswitch l you will see this information
4. If you wish to see this reflected in the VI Client then type: service mgmt-vmware restart Note: This is how my switch configuration looks now
nics to switches 3. If you run the command esxcfg-vswitch l you will see this information
4. If you wish to see this reflected in the VI Client then type: service mgmt-vmware restart Note: This is how my switch configuration looks now
1. esxcfg-vswitch -L vmnic2 vSwtch1 2. If you run the command esxcfg-vswitch l you will see this information
3. If you wish to see this reflected in the VI Client then type: service mgmt-vmware restart Note: This is how my switch configuration looks now
Note: Notice how it doesnt ask are you sure, but then again neither does the VI client.
2. The next part is to set the VLAN id for each network (account, rnd and sales) esxcfg-vswitch v 10 p accounts vSwitch2 esxcfg-vswitch v 20 p rnd vSwitch2 esxcfg-vswitch v 30 p sales vSwitch2 3. If you run the command esxcfg-vswitch l you will see this information
4. If you wish to see this reflected in the VI Client then type: service mgmt-vmware restart Note: This is how my switch configuration looks now
1. First create the Switch, Portgroup and Assign a NIC esxcfg-vswitch a vSwitch3 esxcfg-vswitch A VM Kernel vSwitch3 esxcfg-vswitch L vmnic3 vSwitch3 2. Next use the esxcfg-vmknic command to add in a VM Kernel NIC and set the IP and Subnet Mask esxcfg-vmknic a VM Kernel i 192.168.2.202 n 255.255.255.0 3. Then set the vmkernel default gateway with esxcfg-route 192.168.2.1 4. If you run the command esxcfg-vswitch l you will see this information
If you wish to see this reflected in the VI Client then type: service mgmt-vmware restart Note: This is how my switch configuration looks now
2. To change your IP and Subnet Mask type: esxcfg-vswif i 192.168.2.203 n 255.255.255.0 vswf0 Page 22 RTFM Education
Note: You change your default gateway by editing nano w /etc/sysconfig/network and then restart your networking with services network restart Your DNS settings are located in nano w /etc/resolv.conf
3. To set the speed/duplex of vmnic0 to 100Mps/Half-Duplex type: esxcfg-nics -s 100 -d half vmnic0 4. To reset to auto-neg esxcfg-nics -a vmnic0
1. Logon locally to the ESX host or use your ILO card (do you have choice!) 2. Create a new switch esxcfg-vswitch -a vSwitch0 3. Create a new portgroup esxcfg-vswitch -p "Service Console" vSwitch0 4. Assign a NIC esxcfg-vswitch L vmnic0 vSwitch0 5. Assign a vswif interface and set its ip/sn: esxcfg-vswif a vswif0 -p "Service Console" i 192.168.2.102 n 255.255.255.0
A bit like in ESX 2.x it is possible to set 3-level of security (high, medium and low) High Medium Low incoming/outgoing blocked incoming blocked, outgoing not blocked firewall off, no blocking of incoming/outgoing traffic
Viewing your Firewall Settings 1. Type the command esxcfg-firewall q outgoing esxcfg-firewall q incoming Note: You can also use esxcfg-firewall q on its own. This gives you lots of stuff most useful at the bottom:
Changing Your Security Level Note: If you wanted to weaken your security to medium you could use 1. Type the command esxcfg-firewall --allowOutgoing blockIncoming Note: You should get warnings like so: 2006-07-06 14:39:53 (1965) WARN : Setting firewall default /firewall/blockOutgoing to 0 2006-07-06 14:39:53 (1965) WARN : Setting firewall default /firewall/blockIncoming to 1 Enabling a Single Service/Client/Agent Note: If you want to SSH from an ESX host to another ESX host or SCP from an ESX host to another you need to enable the SSH Client on port 22 If you do this via the GUI and then do a esxcfg-firewall q you will see friendly information like so:
Incoming and outgoing ports blocked by default. Enabled services: AAMClient CIMSLP LicenseClient sshServer CIMHttpsServer CIMHttpServer sshClient vpxHeartbeats dgfdfgdsdsdsd Opened ports: To do the same from the command-line you would type the command: esxcfg-firewall -e sshClient Note: To disable esxcfg-firewall -d sshClient Enabling non-Standard Ports Note: Perhaps there is an application or service which is not listed for use with e or d Or the port numbers have been changed to non-standard ports It is possible to open a specific port by number, transport (udp/tcp) and direction (in/out) To enable port 22 outbound from the server type the command: esxcfg-firewall -o 22,tcp,out,ssh Note: The ssh at the end is a friendly label. If I run esxcfg-firewall q again at the bottom it states: Incoming and outgoing ports blocked by default. Enabled services: AAMClient CIMSLP LicenseClient sshServer Page 26 RTFM Education
What I am going to do is the following: Remove the VMotion Switch0 altogether thus freeing up vmnic0 Remove the Legacy vmnet_0 portgroup from vSwitch1 Remove the Legacy vmnic2 portgroup from vSwitch2 Remove vSwitch3 Create a new vswif interface on a new switch called vSwitch0 using vmnic0 Add vmnic1 to vSwitch2 Patch all my VMs to the Production on vSwitch2 Create with a VM Kernel Port (vSwitch3)
Remove Legacy vmnet_0 portgroup from vSwitch1 esxcfg-vswitch D Legacy vmnet_0 vSwitch1
Remove Legacy vmnic2 portgroup from vSwitch2 esxcfg-vswitch -D "Legacy vmnic2" vSwitch2
Remove Old vswif Interface and Remove vSwitch3 Disable vswif0 interface, and remove from the system You must disable the vswif interface before you delete the switch it is attached to Do this at the physical console via an ILO esxcfg-vswif d vswif0 esxcfg-vswitch d vSwitch3
Create a new vswif1 interface esxcfg-vswitch -a vSwitch0 esxcfg-vswitch -A "Service Console" vSwitch0 esxcfg-vswitch L vmnic0 vSwitch0 esxcfg-vswif a vswif0 -p "Service Console" -i 192.168.2.x n 255.255.255.0 Note: You will get this message [DateVnic warning] Generated New MAC Address, 00:50:56:XX:XX:XX for vswif0 Nothing to flush Note: I found my new vswif0 interface was already enabled. But if doesnt for you might like to try esxcfg-vswif d vswif0 Create a VM Kernel Port esxcfg-vswitch -a vSwitch3 esxcfg-vswitch -A "VM Kernel" vSwitch3 esxcfg-vswitch -L vmnic3 vSwitch3 esxcfg-vmknic -a "VM Kernel" -i 192.168.2.x -n 255.255.255.0 esxcfg-route 192.168.2.1
isos is isos from nfs1.rtfm-ed.co.uk mounted nas-vms is nas-vms from nfs1.rtfm-ed.co.uk mounted templates is templates from nfs1.rtfm-ed.co.uk mounted Restoring NAS Connections Note: If the NAS become unavailable you may have to force a restore the mount This sometimes happens to me if start-up my ESX hosts before the NAS is up 1. Type the command esxcfg-nas r 2. Followed by esxcfg-nas -l
Enabling the iSCSI Adapter 1. Type the command: esxcfg-swiscsi e Allowing software iSCSI traffic through firewall... Enabling software iSCSI... /usr/sbin/vmkload_mod /usr/lib/vmware/vmkmod/iscsi_mod.o Using /usr/lib/vmware/vmkmod/iscsi_mod.o Module load of iscsi_mod succeeded. Note: This will enable the iSCSI Software Adapter like so:
Setting the iSCSI Target IP with Discovery Mode Note: Remember the Software iSCSI adapter does NOT support static discovery 1. Type the command: vmkiscsi-tool -D -a 192.168.2.210 vmhba40 Note: -D sets the mode of Discovery, rather than static. a is used to add an iSCSI Target, followed by IP address of iSCSI Device and the HBA that will be used. vmkiscsi-tool is a powerful little utility with lots of options although documentation is a little bit thin on the ground. I intend to return to this section when I have more time to put some more flesh around it 2. To list the targets configured use: vmkiscsi-tool -l -T vmhba40 Note: This should report:
Forcing a Rescan of the iSCSI Adapter 1. You might wish to list the current LUNs/Disk currently visible with ls l /vmfs/devices/disks
Note: I have two internal disks on an internal SCSI Controller (vmhba0:0 and vmhba0:1) I also a have JBOD with six disks inside (vmhba1:1-6) 2. Force the rescan with esxcfg-swiscsi s Note: This should produce this result Scanning vmhba40... Rescanning vmhba40...done. On scsi2, removing:. On scsi2, adding: 0:0 0:1. 3. If we run the ls command again we can see the 20GB LUNs from my iSCSI box
6. Type P, to print out the partition table (make a mental note of the partition number here) 7. Type T, to change the File System Type 8. Type the Hex Code of fb: (the code for a VMFS partition) Note: This should give the result of Changed system type of partition 1 to fb (Unknown) Hex codes tell the system what file system partition will support 07 NTFS, 82 Linux Swap, 83 Linux File System, FB for VMFS and FC for VMware Core Dump. At this stage the VI Client would identify the partition as VMFS unformatted. 9. Type W, to write your partition table changes to the hard drive it will give you this status information: Note: The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. Note: If you re-run fdisk /vmfs/device/disks/vmhba40:0:0:0 and choose P to display the partition table
Format & Label the VMFS Partition 1. Logon to the Service Console as ROOT 2. To format the new partition with the VMFS file system type: vmkfstools C vmfs2 vmhbaA:T:L:V In my case the hard disk partition is located on the Adapter 40, TARGET 0, LUN 0 on Volume/Partition 1. So I would type: vmkfstools -C vmfs3 S iscsi-lun0 /vmfs/devices/disks/vmhba40:0:0:1 Warning: Please note it is an UPPERCASE C you type here. A lowercase c creates a vmdk file. You can specify b flag to set a block-size. You would need to do this if you thought any one of your virtual disks were going to be greater than 256GB in size. From the PDF Guide 1MB, 2MB, 4MB, or 8MB. When entering a size, indicate the unit type by adding a suffix of m or M. The unit type is not case sensitive. vmkfstools interprets either m or M to mean megabytes Page 34 RTFM Education
2m allows 512GB max file size 4m allows 1024GB max file size 8m allows 2048GB max file size Note: This should give the result like so: Creating file system on "vmhba40:0:0:1" with blockSize 1048576 and volume label "none". Successfully created new volume: 44a7bcf0-8b87cb86-940300065bec0eb6 Note: I repeated this for my other iSCSI LUN 1 fdisk /vmfs/devices/disks/vmhba40:0:1:0 vmkfstools -C vmfs3 S iscsi-lun1 /vmfs/devices/disks/vmhba40:0:1:1 Note: If we re-run ls l /vmfs/volumes will see this information
Note: The UUID is the value in blue. So the try and unchanging volume id is actually something like: /vmfs/volumes/44a38c72-156b2590-be15-00065bec0eb7 2. Type the command: ln -sf /vmfs/volumes/44a38c72-156b2590-be15-00065bec0eb7 /vmfs/volumes/esx1-local Note: The LN makes symbolic links (a bit like shortcuts if you like) s makes/change a symbolic link, -f over-writes the existing symbolic link
Note: The partition table for /sda does NOT follow the recommendations for ESX 3.x this partition table was taken for an ESX 2.x server which was upgraded Note: If you wish to see how the vmhba syntax relates to /dev/sd? You will find that you can still use old ESX 2.x command vmkpcidivy -q vmhba_devs. However, it has been hugely depreciated and you should instead esxcfg-vmhbadevs q vmhba0:0:0 /dev/sda vmhba0:1:0 /dev/sdb vmhba1:2:0 /dev/sdc vmhba1:3:0 /dev/sdd vmhba1:4:0 /dev/sde vmhba1:5:0 /dev/sdf vmhba1:6:0 /dev/sdg vmhba40:0:0 /dev/sdh vmhba40:0:1 /dev/sdi
Note If you want to see all of the information together vmhba ID, /dev name, LVM id and VMFS volume label you can use this perl script #!/usr/bin/perl @array = `/usr/sbin/esxcfg-vmhbadevs -m`; foreach (@array) { ($vmk, $cos, $uuid) = split; ($tmp, $label) = split (/:/, `/usr/sbin/vmkfstools -P /vmfs/volumes/${uuid} | grep "File system label"`); print "$vmk \t $cos \t $uuid \t $label\n"; } This produces an output like so:
You can also use esxcfg-rescan vmhbaN to be rescanned as well which give this kind of output: Rescanning vmhba1...done. On scsi1, removing: 2:0 3:0 4:0 5:0 6:0. On scsi1, adding: 2:0 3:0 4:0 5:0 6:0. Managing SCSI Reservations of LUNs Note: Occasionally, things go wrong. Such is life. One example is when through a configuration error a SCSI reservation (lock) is put on a LUN, which subsequently doesnt get released. Until a LUN is released you wont be able manage the file system and other ESX host will not be very happy bunnies. Typically, these kind of reservation problems happen in clustering scenarios This locking is controlled by the L switch on vmkfstools From the Server Configuration guide: -L reserve . Reserves the specified LUN. After the reservation, only the server that reserved that LUN can access it. If other servers attempt to access that LUN, they will get a reservation error! -L release . Releases the reservation on the specified LUN. Any other server can access the LUN again. -L lunreset Resets the specified LUN by clearing any reservation on the LUN and making the LUN available to all servers again. The reset does not affect any of the other LUNs on the device. If another LUN on the device is reserved, it remains reserved. -L targetreset . Resets the entire target. The reset clears any reservations on all the LUNs associated with that target and makes the LUNs available to all servers again. -L busreset . Resets all accessible targets on the bus. The reset clears any reservation on all the LUNs accessible through the bus and makes them available to all servers again This command use the device parameter so uses the /vmfs/devices/disks/vmhbaA:T:L:P syntax
FAT32 is supported for read/write. There are some free EXT3 drivers for Windows (the one I use currently only works on NT4, W2K and WXP, not W2K3) You might prefer to use EXT3 if you wish to export virtual disks in their monolithic format (on VMFS partition) into a the COW format (copy-onwrite) which will take up less physical space on the disk In my case it was dead easy I plugged the USB device into the server. It came up with a message and said it allocated the id of /dev/sdc to the disk. So all I had to do was mount it with mkdir /mnt/usbdisk mount /dev/sdc1 /mnt/usbdisk Note: If this doesnt happen to you then you MIGHT find the stuff below useful.
Systems using the USB-UHCI device driver with the USB 2.0 interface can cause ESX Server to show a false warning message during the boot sequence. The error looks like this on boot-up
Mar 29 11:04:10 vmserver1 rc.sysinit: Initializing USB controller (usb-uhci): succeeded Mar 29 11:04:10 vmserver1 modprobe: Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters Mar 29 11:04:10 vmserver1 modprobe: /lib/modules/2.4.9vmnix2/kernel/drivers/usb/usb-ohci.o: init_module: No such device Mar 29 11:04:10 vmserver1 modprobe: /lib/modules/2.4.9vmnix2/kernel/drivers/usb/usb-ohci.o: insmod /lib/modules/2.4.9mnix2/kernel/drivers/usb/usb-ohci.o failed Mar 29 11:04:10 vmserver1 modprobe: /lib/modules/2.4.9vmnix2/kernel/drivers/usb/usb-ohci.o: insmod usb-ohci failed Mar 29 11:04:10 vmserver1 rc.sysinit: Initializing USB controller (usb-ohci): failed
Note: This was taken from ESX 2.x server It is safe to ignore this message, but if you want to configure your system so that this warning does not appear the next time you boot your ESX Server machine, follow these steps Link: Answer ID 1659 You might find these other article related to USB and IRQ sharing which you might find interesting 1651 - Using USB Storage Devices on the ESX Server Service Console 1290 - IRQ Sharing May Impact Performance 1326 - Using USB When ESX Server Disables It If you want to use a USB hard-drive to copy files from the ESX server to it and you have these errors -then a general work around is to boot to a Knoppix Boot CD and do it that way. Remember if you are copying virtual disks these will have to be exported to the COW format first. If you have no errors like me then this how you can go about using USB
hard-drives and devices To list what type of USB host controller interface you have. There are 3 of USB host controller interface types (OHCI, UHCI and EHCI) You can use the command below to find out yours: lspci -v | grep HCI Note: My server returned: 00:0f.2 USB Controller: ServerWorks OSB4/CSB5 OHCI USB Controller (rev 05) (prog-if 10 [OHCI]) Subsystem: ServerWorks OSB4/CSB5 OHCI USB Controller so I know my server I know I need to load the OHCI driver, not the UHCI or EHCI driver 1. Logon to the Service Console as ROOT 2. [Optionally] Load up the USB Device Drivers insmod usbcore insmod usb-storage modprobe usb-ochi or modprobe usb-uhci or modprobe ehci 3. Use the dmesg to print a out a list of active devices and scroll up to locate Initializing USB Mass Storage Driver.
Note: The system assigns a SCSI device ID to the USB device (even though its like to be IDE Laptop Disk if its a portable hard-drive). The critical bits are reference to the SDG. This tells me the USB device has been added to the end of all my other SCSI disks (sda, sdb, sdc). This will help me in the next stage which is creating a mount point and mounting the partition on the USB disk. Adding additional hard-drives to the system can upset this allocation of sdn. 4. Create a mount point with
mkdir /mnt/usb 5. Mount the first partition on the disk with mount /dev/sdg1 /mnt/usb Note: If you unsure about the partition scheme on the disk you can use fdisk l /dev/sdg to print to the console the partition table 6. List Files and Start using the disk with ls l /mnt/usb 7. Umount the USB device when finished with cd / umount /mnt/usb Note: Even after unmounting the drive. If I should down the ESX server with the USB Storage attached I get this worrying message which could be benign
scsi: device set offline not ready or command retry failed after bus reset : host 2 channel 0 id 0 lun 0 i/o error: dev 08:62, sector 4168 i/o error: dev 08:62, sector 4168 i/o error: dev 08:62, sector 0
disk, not a virtual IDE drive. 4. Save you VMX file and Exit nano 5. Power on your virtual machine with vmware-cmd l Note: Thats a lower-case L for lima. This produces a list of registered VMs on the ESX host vmware-cmd /vmfs/volumes/44a38c72-156b2590-be1500065bec0eb7/instructor/instructor.vmx start Note: In the past we used to be able to use the friendly volume label. This is no longer supported as outline in KB 2122
partition WITHIN a LUN 3. Next we need to add this into the virtual machine, we can do this by editing the VMX file nano -w /vmfs/volumes/local-esx1/instructor/instructor.vmx and the lines: scsi0:2.present = "true" scsi0:2.fileName = " instructor_1.vmdk" RDM for Physical Compatibility Note: Physical compatibility (required for physical to virtual clustering) is set up in a very similar way. With physical compatibility the SCSI Reservations/Filtering normally imposed by the vmkernel are loosened such that other systems that also want to impose SCSI reservations will work (such as clustering systems) This is sometime referred to as a Pass-Through RAW Device Mapping In this case the switch is z vmkfstools a lsilogic -z /vmfs/devices/disks/vmhba40:0:1:0 /vmfs/volumes/local-esx1/instructor/instructor_2.vmdk Note: In this case the system labels the corresponding file instructor_2rdmp.vmdk. So we know this is a RAW Disk Mapping file with physical compatibility Viewing RDM Information Note: In the past it wasnt easy (impossible?) to view the contents of an RDM file (I guess you could have used vmkfstools l to list files and see which were virtual disks and which were RDMs). There is now a switch to query the metadata file which then reports information 1. vmkfstools q /vmfs/volumes/local-esx1/instructor_1.vmdk Disk instructor_1.vmdk is a Non-passthrough Raw Device Mapping Disk Id: vml.010000000020202020564952545541 Maps to: vmhba40:0:0:0 2. vmkfstools q /vmfs/volumes/local-esx1/instructor_2.vmdk Disk instructor_2.vmdk is a Passthrough Raw Device Mapping Disk Id: vml.010001000020202020564952545541 Maps to: vmhba40:0:1:0 Note: You can also cat the contents of the metadata file as well but the VM MUST be powered off first! cat /vmfs/volumes/local-esx1/instructor_2.vmdk
# Disk DescriptorFile version=1 CID=0a8fee69 parentCID=ffffffff createType="vmfsRawDeviceMap" # Extent description RW 8388608 VMFSRDM "instructor_2-rdm.vmdk" # The Disk Data Base #DDB ddb.toolsVersion = "7172" ddb.adapterType = "lsilogic" ddb.geometry.sectors = "63" ddb.geometry.heads = "255" ddb.geometry.cylinders = "522" ddb.virtualHWVersion = "4" cat /vmfs/volumes/local-esx1/instructor_3vmdk # Disk DescriptorFile version=1 CID=3cfc3778 parentCID=ffffffff createType="vmfsPassthroughRawDeviceMap" # Extent description RW 8388608 VMFSRDM "instructor_3-rdmp.vmdk" # The Disk Data Base #DDB ddb.toolsVersion = "7172" ddb.adapterType = "lsilogic" ddb.geometry.sectors = "63" ddb.geometry.heads = "255" ddb.geometry.cylinders = "522" ddb.virtualHWVersion = "4"
This is what the MAN pages say about the d switch: zeroedthick This is the default option when creating new virtual disks. A zeroed thick disk has all space allocated at creation time, and this space is wiped clean of any previous contents on the physical media. eagerzeroedthick An eager zeroed thick disk has all space allocated and zeroed out at creation time. Such disks may take longer time during creation compared to other disk formats. thick A thick disk has all space allocated at creation time. This space may contain stale data as it exists on the physical media. thin Space required for thin-provisioned virtual disk is allocated and zeroed on demand as opposed to upon creation. Another purpose is for backup the sparse format holds the true data minus any free space so generally more efficient for backup purposes.
Related to this there is also the switch -j Convert a thin virtual disk to thick with the additional guarantee that any data on thin disk is preserved and any blocks that were not allocated get allocated and zeroed out.
Another purpose is from transporting virtual disks safely to/from other vPlatforms such as Workstation on Linux or Windows or VMware Server (nee GSX) on Linux or Windows Perhaps you dont have VC you still have a stand-alone ESX servers and you still use templates and import/export method of ESX 2.x days For those of you from a ESX 2.x background you should know the old e switch is depreciated and the way do a e is with i and some additional switches in vmkfstools
Exporting Zeroedthick Virtual Disks (nee Monolithic) into the Sparse (nee COW) Format Note: In my case I am using /vmimages partition. But you could use any EXT3 location or even export directly to a mount NFS or SMB share 1. Type the command: vmkfstools -i /vmfs/volumes/local-esx1/instructor/instructor.vmdk -d 2gbsparse /vmimages/instructor.vmdk Note: You should get response like this Destination disk format: sparse with 2GB maximum extent size Cloning disk '/vmfs/volumes/local-esx1/instructor/instructor.vmdk'... Clone: 3% done. Page 47 RTFM Education
Note: The disk is now in a portable format you could tar it up and copy somewhere else for backup purposes connect with WinSCP on your workstation and bring the files down to your PC. If you have VMware Workstation on your PC you could configure a virtual machine to use this disk Importing Virtual Disk from the Sparse Format Note: For those you that a familiar with ESX 2.x this process hasnt changed much at all. What is different is because VMFS now stores directories, and the VMs configuration files are held in a directory is where do you restore the disk too The easiest way to do this I think is, to first create a VM without a virtual disk this will set-up up the directory the configuration files. Then trigger the vmkfstools import to the vmfs volume and directory and then edit the VMX file to tell the VM where its new disk is (as I showed just previously with c) 1. Type the command: vmkfstools -i /vmimages/workstationdisk.vmdk /vmfs/volumes/localesx1/workstation1/workstation1.vmdk Destination disk format: VMFS thick Cloning disk '/vmimages/media.vmdk'... Clone: 10% done.
Warning: Permanently added esx1.rtfm-ed.co.uk, 192.168.2.102' (RSA) to the list of known hosts. 3. At the prompt which reads [email protected] password: type the other servers root password, in my case ******** Note: In this screen grab I copied the tar file for upgrade of esx 2.x to 3.x The system will give you a status bar like this
# Extent description RW 4194304 VMFS "instructorOS-flat.vmdk" xdgkdkfdlkfjldkjflkjsdf # The Disk Data Base #DDB ddb.adapterType = "lsilogic" ddb.geometry.sectors = "63" ddb.geometry.heads = "255" ddb.geometry.cylinders = "261" ddb.thinProvisioned = "1" ddb.virtualHWVersion = "4" ddb.toolsVersion = "7172" Note: Remember, you still have to manually edit the VMX file to reflect your changes
Expect a number of reboots for the one asked for by the Partitioning tool, and the one called for by Windows. This can be somewhat annoying!
Caution: Copy/Backup/Gzip/Export the VMDK in case the next procedure fails Note: I noticed that Knoppix is susceptible to disconnections from the Remote Console especially when you are shutting down the VM after booting from the ISO 1. Shutdown the VM 2. Type the following command: vmkfstools X 6144m force /vmfs/volumes/local/instructor.vmdk Note: If you follow this command with ls l h you will see it is bigger. Again I could have specified 6g instead of 6144m. Its flat file that changes size the metadata file stays the same but has new geometry information 3. Start-up the VM, and check that it boots properly Note: You may get error loading operating system messages if the vmdk file has become corrupted 4. Connect to the ISO which contains the Knoppix Boot CD - Using Remote console attach to this ISO file making sure you enable X Connected at Power On 5. Power on the VM 6. Change the boot order on the VM to give the CD-ROM the highest priority allow the system to boot to Knoppix CD or use the [ESC] key to select the CD-ROM as a the boot device 7. Click at the Knoppix KDE button
9. Choose Qparted Note: Qparted will display the partition/disk layout of the virtual machine.
In this case the IDE CD-ROM and single SCSI boot disk (sda) 10. Select /inionfs/dev/sda Note: This then shows the partition table on that virtual disk
In this case a single C drive of 4GB with free space on the hard-drive of 2GB added by using vmkfstools X 6096mg 11. Select Partition No 01 12. Right-click and choose &Resize 13. In the dialog box drag to increase or decrease the size of Partition 01
Using the
14. Click File, and choose &Commit Note: Page 52 RTFM Education
Confirm the warnings by click the Yes button and watch the dialog boxes go by and Confirm the Success dialog by clicking OK 15. Shutdown the Virtual Machine 16. Disconnect the CD-Rom Note: This will allow the VM to boot to the VMDK file rather than to the CD-Rom. ` 17. Reboot the Virtual Machine Note: In Windows 2003 you will see check disk events this appears to be normal. Additionally, you will find Windows 2003 will detect the hard-drive as if it was a new device and request a reboot.
Using VMware-cmd
Note: It works by manipulating the VMX and sending instructions to the VM via the VMX file There are lots you can do with this command. Beyond what is feasible in this document. For further information look at the Scripting Guide for ESX It also returns 1 for positive results, and 0 for failures so can use it for BASH shell scripts and if statements To List Registered VMS 1. Type: vmware-cmd l Note: List paths and names of VMX files. Useful for when you have type long paths to the VMX file. You can highlight an entry in the list and copy it to your command-line. Unfortunately, vmware-cmd no long supports volume names instead you have to use the UUID path to the VMX file. I will give one example of vmware-cmd with the UUID, after that I will replace the string with <UUID> because its so blummin long!
To Register and Un-register a VM 1. Type: vmware-cmd -s unregister /vmfs/volumes/44a38c72-156b2590-be1500065bec0eb7/instructor/instructor.vmx Note: Also includes register as a command. S stands for set. This un-registers a VM from an ESX host (stand-alone) Unfortunately, it does NOT un-register it from VirtualCenter. Instead you are left with an orphaned VM that needs right-clicking and Remove from the Inventory
I think this happens because what vmware-cmd s is manipulating is what used to be called the vm-list. Its not manipulating the VC database. Note: Why is the command still useful? We say you had a server failure which you had rebuild. You then need to register the VMX file with an ESX server to then be able to manage it. If you had 40 VMX you wouldnt want to do that by hand using the GUI. Power Options on a VM Note If you use trysoft, the Guest OS will be shutdown gracefully. The trysoft is a mode option it tries to run the normal scripts but uses a hard shutdown/startup if the VM is not behaving properly. There are two other modes soft which runs scripts but never does a hard start or stop or hard which powers off/on a VM as if you had hit the power switch. Sometimes people use trysoft first, and then if the VM refuses to power of, they follow it with hard power off
1. To
2. To
3. To
vmware-cmd /vmfs/volumes/<UUID>/instructor1/instructor1.vmx suspend Note: There isnt much in the way of status/progress here. The old-style Remote Console from ESX 2.x days used to give you dialog box with a status bar
4. To
vmware-cmd /vmfs/volumes/<UUID>/instructor1/instructor1.vmx start trysoft Note: There is no resume switch on vmware-cmd just a power-up which retrieves the suspend file, and resumes the machine
5. To
vmware-cmd /vmfs/volumes/<UUID>/instructor1/instructor1.vmx reset trysoft Note: This a soft reboot of the virtual machine 6. To find out the Power Status of a VM use: vmware-cmd /vmfs/volumes/<UUID>/instructor1/instructor1.vmx getstate Note: It will return On; Off; Suspend and Stuck if the VM is waiting for interaction Finding the Heartbeat 1. Type: vmware-cmd /vmfs/volumes/<UUID>/instructor1/instructor1.vmx getheartbeat Note: You should see a number. Repeat the command. If the number increments the machine is alive. It stays the same it is dead. It doesnt have a heart beat! Finding the Status Of Devices Note: The Vmware-cmd tools is able to find the configuration of the VMX file, and also change entries in the file. To find out what the status is of the CD-ROM you would use:
1. vmware-cmd /vmfs/volumes/<UUID>/instructor1/instructor1.vmx getconfig ide0:0.deviceType Note: The CD-ROM is emulated (but not Virtualized) IDE 0:0 channel. This is how the CD-ROM is addressed in a Windows Environment. A safe way of learning the VMX variables is just print the VMX file to the console with: cat /vmfs/volumes/<UUID>/instructor1/instructor1.vmx | more Configuring & Connecting a Device This used to work in the past and none of these commands give an error message but I dont get the desired result They must have changed this from ESX 2.x days and dont what the next step is Note: As long as you know the name of the variable in the VMX file you can change anything you like from the command line. For example there is a variable called ide0:0.fileName = which controls the path for the CD-ROM be it physical or an ISO image. There is a variable called ide0:0.deviceType = which controls if it is the physical or ISO image (atapi-cdrom for the physical and cdrom-image if it is an ISO file). In this example we will attach an ISO to the CD-ROM and Connect the CD-ROM to the VM. You may wish to have VC Console open whilst your doing this to see visually the effect of your changes. I assume that initially the CD-ROM is connected to the physical CD 1. First, Disconnect the current device with: vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx disconnectdevice ide0:0 2. Change to the system to use a ISO file instead of a physical CD with: vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx setconfig ide0:0.deviceType cdrom-image Then set the image file to use with: vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx setconfig ide0:0.fileName /vmfs/volumes/isos/w2k3.iso 3. To Refresh the OS - Reconnect the device with: vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx connectdevice ide0:0 Note: Now that the CD is set as an ISO file. You merely need to stages 2 and 3 to switch from one ISO file another. The whole process could be put in SH script like so: vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx disconnectdevice ide0:0 vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx setconfig ide0:0.deviceType cdrom-image Page 56 RTFM Education
vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx setconfig ide0:0.fileName /vmimages/w2k3ent.iso vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx connectdevice ide0:0 Notes: To Undo and go back to the physical CD-ROM vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx disconnectdevice ide0:0 vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx setconfig ide0:0.deviceType atapi-cdrom vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx setconfig ide0:0.fileName /dev/cdrom vmware-cmd /home/lavericm/vmware/instructor1/instructor1.vmx connectdevice ide0:0
goal = 2181818 Do While True before = Timer For i = 0 to goal x = 0.000001 y = sin(x) y = y + 0.00001 Next y = y + 0.01 WScript.Echo "I did three million sines in " & Int(Timer - before + 0.5) & " seconds!" Loop
3. Run the script on just one VM with: cscript //nologo cpubusy.vbs Note: This should produce lots of CPU cycles and this message in a cmd prompt:
Run ESXTOP at the Service Console Note: 1. esxtop is dynamic tool so every couple of second it updates but heres a snapshot in time (you might want to zoom in here!)
Interpretation: Server1 is busy with %used at 99.17. The ESX server is doing it best to load the CPU request across my two physical CPUs (PCPU(%) is at 62.40 and 40.50. The %RDY value is quite low for VM called instructor and server1. So although server1 is busy, they are still performing well Run CPUbusy.vbs on the Second VM and Check out ESXtop
Interpretation: With two VMs running the script my PCPUs are beginning to max out at 99.67 and 99.61. Now the VM called instructor is as busy as server1. The %RDY value has increased but not massively so. With just two VMs with a
vCPU each the vmkernel is analyzing the cpu performance to make sure the two VMs dont fight against each other Deliberate Mis-configuration Creating contention Note: By default a single vCPU VM runs on any CPU that has free CPU cycles We can use processor affinity to cause contention by pegging each VM to the same CPU 1. 2. 3. 4. 5. 6. Do this on BOTH VMs Properties of the Virtual Machine Select the Resources Tab Choose Advanced CPU Under Scheduling Affinity, choose Run on processor(s) Select just one CPU for the VM like so:
Interpretation: Here my CPU0 is no longer busy, but CPU1 is maxd out at 100.00% Both VMs are getting an equal share of the CPU at 50.08% and 49.89%. The %RDY value has grown massively to 50%. This is contention and its bad VMware say anything over 5-10% needs dealing with. So what our options? VMotion one of these VMs to less busy ESX host Increase shares to instructor because it is more important Decrease shares to server1 because it is less important Remove the contention the CPU overlap we have just created Increasing Shares on VM Note: Shares are method of favouring on VM over others when contention takes place. No contention. The share values do nothing and VMs scream along as fast as they can. But when contention occurs resources are divvied up according to the share value In my case I am going to give the instructor a 3000 shares, and the other VM left at 1000. Thats 4000 shares altogether so the instructor VM will receive of CPU time, and server1 will get 1. 2. 3. 4. 5. 6. Right-click one of your VMs Edit Settings Click the Resources Tab Select CPU from the list of settings Next to Shares, choose Custom Increase to 4000
Interpretation: My physical CPU is just as busy. The Instructor vm is getting 80% of CPU () and server1 is getting just 20% (). The %RDY value is reflecting an inverse proportion. So as Instructor is getting more CPU time is %RDY value is lower (22%) than server2, which is getting less CPU time (84%) Conclusions High CPU values in esxtop in themselves are not a problem in fact the higher the better. Whats the point of virtualisation if the server only runs at 5% of its capacity. Or put another waywhats the point of building an oil pipeline that only ships 5% of oil. The rest is spare and wasted capacity that could be used to increase output What matters is bottlenecks - %RDY values are good indicator of bottleneck in our pipeline Dont trust what the guest operating system says. Both of my VMs report 100% CPU usage when actually they are using 80% () and 20% () of the processor See screen dumps on the next page
Server1 with 1000 shares mmm Im looking at the time on the screen dumps here. I should call it day
Memory free m will list how much RAM has been allocated to the Service Console. Interesting on my upgrade ESX 2.x box the amount memory was left at 256MB. On a cleanly install ESX 3.x box its around the 500MB mark vmstat 5 10 will give virtual memory/swap statistics every 5secs in my case with 10 samples. Watch out for s/i and s/o any regular swap activity indicates that Service Console lacks RAM just like in Windows
Disk The likelihood of filling / is now much less but it could still happen Due to excessive logging in /var/log or agent logging in /opt. If these are directories rather partitions you might have problem Also if some miss uses vmkfstools i they could be creating very big files in the wrong location You can use df h or vdf h to see how full your file systems are
5. cd in to the esx-3.?.?-?????-upgrade directory 6. Run the Perl script called ./upgrade.pl Note: The system will verify files, and then ask you to read & accept an EULA! 7. Choose Q, to quit reading the EULA, and 8. Type Yes [Enter] to accept the EULA Note: You will receive status messages like so: Upgrading packages (this may take a while) ... .... done Removing obsolete packages .... done Upgrading system configuration ... Running vmware-config.pl ... done then lastly *** You must now reboot the system into Service Console mode and run upgrade2.pl *** Reboot the server now?[y/n] 9. At the Reboot the Server now [y/n] choose N and [Enter] 10. Now edit the boot.conf file to make sure the server boots to the Service Console with: nano w /boot/grub/grub.conf change default=0 to default=1 11. Now do the reboot with the command: reboot Note: You might find you loose connectivity to the Service Console. I did on my first attempt. The second time I didnt get a script error and my Service Console networking was intact. The interesting thing is the upgrade was done on an identical ESX 2.x host. I know it was identical as it was the same physical machine cloned with ghost which contain an image of ESX. Perhaps these network errors were related to the boot errors? Run Second Script & Revert to ESX Boot Option 1. Logon to the Service Console with PuTTY, as ROOT Note: You will know you have boot to do the Service Console because of this message.
ALERT [Wed May 17 21:19:45 GMT 2006]: This VMware ESX Server machine is currently booted into troubleshooting mode. 2. cd in to the esx-3.?.?-?????-upgrade directory 3. Run the Perl script called ./upgrade2.pl Note: You will receive this status messages like so: This script will complete upgrading your ESX server to version 3.x.x Verifying Files don Upgrading Packages (this may take a while). INIT: Version X.x.x reloading done *** You must now reboot the system into the ESX Server mode to finish the upgrade *** 4. At the Reboot the Server now [y/n] choose N and [Enter] 5. Now edit the boot.conf file to make sure the server boots to the Service Console with: nano w /boot/grub/grub.conf change default=1 to default=0 6. Now do the reboot with the command: reboot Note: This will boot the ESX 3.x Vmkernel for the first time. The remote upgrade is complete. Note: If you wish to automate the change to grub.conf, this script is from IBM is called bootcontrol.pl you can download the zip file directly here. The very first time you run this command it returns an error which states "Use of uninitialized value in numeric eq (==) at bootcontrol.pl line 99". It does actually shift the boot option - and the error only occurs once. I've emailed the guys who wrote it - but I have a feeling its cause by our partially completed upgrade process. This command re-compiles the grub loader so that the Service Console Only (troubleshooting only) menu is chosen. It does that by changing the value in grub.conf called Default 0 to being Default 1
I would like to thank Mostafa Khalil, VCP (SE) for his Troubleshooting presentation at VMware TSX in Paris 2006. Gotchas You need free space to upgrade to VMFSv3 Watch out for block sizes. VMFSv2 support a max block size of 16MB. Whereas VMFSv3 supports 8MB. You cannot do an upgrade of VMFS2 to VMFS3 if this is the case. You in backup and restore territory. Hopefully, this will effect a very few number of people Note: From man pages of vmkfstools. VMFS-2 to VMFS-3 file system upgrade is a two step process. Before file system upgrade can begin the vmfs2 and vmfs3 driver must be unloaded and the auxiliary file system driver, fsaux, should be loaded. The first step of upgrade uses the -T option. Once the first step completes, the auxiliary file system driver, fsaux, is unloaded and, vmfs2 and vmfs3 drivers are reloaded. The second step of file system upgrade makes use of the u option. -T, --tovmfs3 converts a VMFS-2 file system on the specified partition to VMFS-3 format, preserving all files on the file system. The conversion is in-place and the auxiliary file system driver (fsaux) module must be loaded. The ESX Server file system locking mechanisms will try to ensure that no local process or remote ESX Server is currently accessing the VMFS file system to be converted. The conversion is a one-way operation and once the VMFS-2 file system is converted to VMFS-3 file system, it cannot be rolled back to VMFS-2. -u, --upgradefinish /vmfs/volumes/<label/UUID>/ once the first step of file system upgrade has completed (using -T), the vmfs2 and vmfs3 modules are reloaded and the -u option is used to complete the upgrade 1. Logon to the Service Console as ROOT 2. Unload the vmfs2 driver with: vmkload_mod -u vmfs2 3. Unload the vmfs3 driver with: vmkload_mod -u vmfs3 4. Load the FS Auxiliary Driver with the upgrade function vmkload_mod fsaux fsauxFunction=upgrade 5. Run the first stage of the upgrade with vmkfstools -T /vmfs/volumes/local -x zeroedthick Note: -x zeroedthick (default) . Retains the properties of VMFS-2 thick files. With Page 68 RTFM Education
the zeroedthick file format, disk space is allocated to the files for future use and the unused data blocks are not zeroed out. -x eagerzeroedthick . Zeroes out unused data blocks in thick files during conversion. If you use this sub-option, the upgrade process might take much longer than with the other options. -x thin . Converts the VMFS-2 thick files into thin-provisioned VMFS-3 files. As opposed to thick file format, the thin-provisioned format doesn't allow files to have extra space allocated for their future use, but instead provides the space on demand. During this conversion, unused blocks of the thick files are discarded. Note: This will give you the following message I got /vmfs/volumes/44a38c72-156b2590-be15-00065bec0eb7 VMware ESX Server Question: Please make sure that the VMFS-2 volume /vmfs/volumes/44a38c72156b2590-be15-00065bec0eb7 is not in use by any local process or any remote ESX server. We do recommend the following: 1. Back up data on your volume as a safety measure. 2. Take precautions to make sure multiple servers aren't accessing this volume. 3. Please make sure you have approximately 1200MB of free space on your volume. Note that the number is an upper bound, as the actual requirements depend on physical layout of files. Continue converting VMFS-2 to VMFS-3? 0) Yes 1) No 6. Type 0, and press [Enter] Note: Currently, you get no status information while this is proceeding. It should complete with this message: Filesystem upgrade step one completed. Step two must be completed after the vmfs2 and vmfs3 modules are reloaded. When ready, run 'vmkfstools -u /vmfs/volumes/local' to complete the upgrade. 7. Once this part has completed confirm that your format is VMFS-3 vmkfstools -P /vmfs/volumes/local Note: This should report something like this: VMFS-3.21 file system spanning 1 partitions. File system label (if any): local Mode: public Capacity 36238786560 (34560 file blocks * 1048576), 5511315456 (5256 Page 69 RTFM Education
blocks) avail UUID: 44a38c72-156b2590-be15-00065bec0eb7 Partitions spanned: vmhba0:1:0:1 8. Confirm you files havent disappeared in the process with: ls l /vmfs/volumes/local 9. Next, unload the Auxiliary Files System Driver and reload you VMFS2 and VMFS3 driver with: vmkload_mod -u fsaux vmkload_mod vmfs2 vmkload_mod vmfs3 Note: You should get Module load of vmfs2succeeded and Module load of vmfs3succeeded 10. Restart the hostd service for these changes to be reflected in the VI client with: service mgmt-vmware restart Note: The guide finishes here if you were doing an upgrade I would progress to Module 4 of my upgrade guide