Archive

Posts Tagged ‘Virtualisation’

Monitoring HP ESXi Host hardware

February 2nd, 2011 No comments

I often see people on forums, complaining that they are unable to monitor their HP hardware (or Dell or IBM) from within their virtual Centre.

The HP ESXi Offline Bundle for VMware ESXi 4.1 should be installed to fix this.

you can download the bundle at http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?swItem=MTX-b98795300e7947d88f19ab56d6&lang=en&cc=us&idx=1&mode=4

If you’d like to check if it is already installed on one of your hosts, simply putty to the host (assuming that you have enabled SSH) and run the following:

~ # esxupdate  query——Bulletin ID——- —–Installed—– ——-Summary——-ESXi410-GA               2010-07-28T10:46:07 ESXi upgrade Bulletinhpq-esxi4.1uX-bundle-1.0 2010-08-04T14:57:25 HP ESXi Bundle 1.0~ #

Alternatively, if you have a vMA appliance or access to RCLI, you can use the following:

Using RCLI:
vihostupdate.pl –server <server> –query

 

http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?swItem=MTX-b98795300e7947d88f19ab56d6&lang=en&cc=us&idx=1&mode=4&
(posted below for ease of access)

Installation:
Update an ESXi Host Using Offline Bundles with the vihostupdate Utility
You can use the vihostupdate utility in conjunction with offline bundles or with a depot. This topic describes
the procedure using offline bundles.
Prerequisites
Before you can update or patch an ESXi host from the command line, you must have access to a machine on which you can run the VMware vSphere Command-Line Interface (vSphere CLI). You can install the vSphere CLI on your Microsoft Windows or Linux system or import the VMware vSphere Management
Assistant (vMA) virtual appliance onto your ESXi host. For information about importing or installing the
vSphere CLI, see the VMware vSphere Command-Line Interface Installation and Reference Guide.
Procedure
1 Power off any virtual machines that are running on the host and place the host into maintenance mode.
2 Find out which bulletins are applicable to the ESXi host.
• Search an offline HTTP server:
vihostupdate.pl –server <server> –scan –bundle http://<webserver>/rollup.zip
• Search the local machine:
vihostupdate.pl –server <server> –scan –bundle <local_path>/rollup.zip
The –server argument is the ESXi host name or IP address.
Do not specify more than one bundle ZIP file at the command line each time you run the command. If you
specify –bundle more than once, the command processes only the last file that was specified.
3 (Optional) List all the bulletins that are available in the bundle.
• Search an offline HTTP server:
vihostupdate.pl –server <server> –list –bundle http://<webserver>/rollup.zip
• Search the local machine:
vihostupdate.pl –server <server> –list –bundle <local_path>/rollup.zip
This command lists all the bulletins contained in the bundle, even those that do not apply to the host.
4 Install bulletins from the bundle on the ESXi host.
• Install from an offline HTTP server:
vihostupdate.pl –server <server> –install –bundle http://<webserver>/rollup.zip –bulletin bulletin1,bulletin2
• Install from the local machine:
vihostupdate.pl –server <server> –install –bundle <local_path>/rollup.zip –bulletin bulletin1,bulletin2
If you omit the –bulletin argument, this command installs all the bulletins in the bundle.
5 Verify that the bulletins are installed on your ESXi host.
vihostupdate.pl –server <server> –query
6 (Optional) Remove individual bulletins.
vihostupdate.pl –server <server> –remove –bulletin bulletin1
Use this option only for removing bulletins that are third-party or VMware extensions. Do not remove
bulletins that are VMware patches or updates. vihostupdate can remove only one bulletin at a time.
Uninstall a Bundle from a Host
Use this procedure to uninstall bulletins that are third-party or VMware extensions.
Do not remove bulletins that are VMware patches or updates.
Prerequisites
Before you can uninstall an update or patch from an ESXi host from the command line, you must have
access to a machine on which you can run the VMware vSphere Command-Line Interface (vSphere CLI). You can install the vSphere CLI on your Microsoft Windows or Linux system or import the VMware vSphere
Management Assistant (vMA) virtual appliance onto your ESXi host. For information about deploying or installing the vSphere CLI, see the VMware vSphere Command-Line Interface Installation and Reference Guide.
Procedure
1 Determine which bulletins are installed on your ESXi host.
vihostupdate.pl –server <server> –query
Note the bundle ID for the bundle to uninstall.
2 Run the vihostupdate command.
vihostupdate –server <server> –remove –bulletin <bulletin ID>
vihostupdate can remove only one bulletin at a time.

Categories: VMWare Tags: ,

VMKFSTOOLS Man Pages

February 1st, 2011 No comments
VMKFSTOOLS                 VMware ESX Server Manual                 VMKFSTOOLS

NAME
     vmkfstools - VMware ESX Server file system management tool

SYNOPSIS
     vmkfstools OPTIONS
     vmkfstools OPTIONS PARTITION
     vmkfstools OPTIONS DEVICE
     vmkfstools OPTIONS PATH

COPYRIGHT
     VMware ESX Server is Copyright 2000-2006 VMware, Inc. All rights
     reserved.

DESCRIPTION
     vmkfstools is a program for creating and manipulating virtual disks, file
     systems, logical volumes and physical storage devices on the VMware ESX
     Server. It supports the creation of a VMware ESX Server File System
     (VMFS) on a partition of a disk, and the management of files (such as
     virtual disks) stored on VMFS.

     OPTIONS is one or more command-line options that specify the operation.
     The file or VMFS file system being manipulated may be specified after the
     options by a relative or absolute file path name in the /vmfs hierarchy.

     The PARTITION argument is used for specifying partitions, and should be
     of the form vmhbaA:T:L:P where A, T, L and P are integers representing
     adapter, target, LUN and partition respectively. The partition digit must
     be greater than zero.  For example, vmhba0:2:3:1 refers to the first par-
     tition on LUN 3, target 2, HBA 0.

     The DEVICE argument is used for specifying devices, and should be a path
     name beginning with /vmfs/devices, which is the mount point of the device
     file system. There are sub-mounts for each device class. For example,
     /vmfs/devices/disks for local or SAN-based disks, /vmfs/devices/lvm for
     VMKernel logical volumes, /vmfs/devices/generic for generic SCSI devices
     like tape drives, etc.

     The PATH argument is used for specifying a VMFS file system or file, and
     should be an absolute or relative path that names a directory or a file
     under /vmfs.  For example, a VMFS file system could be specified via a
     path such as:

     /vmfs/volumes/<file_system_UUID> or /vmfs/volumes/<file_system_label>

     A VMFS file would be specified via a path such as:

     /vmfs/volumes/<file_system_label|file_system_UUID>/[dir]/myDisk.vmdk or
     myDisk.vmdk

     if the current working directory is the parent directory of myDisk.vmdk.
:

FILE SYSTEM OPTIONS
     The long and short forms of options, shown here listed together, are
     equivalent.

     -C, --createfs vmfs3
     -b, --blocksize #[mMkK]
     -S, --setfsname fsName
         Create a VMFS file system on the specified partition,
         e.g. vmhba1:0:0:1. The partition becomes the file systemâs head
         partition. The file block size can be specified via the ´-b´
         option. The default file block size is 1MB. The file block size
         must be either 1MB, 2MB, 4MB or 8MB. In ESX Server 3, VMFS-2 file
         systems are read-only in that users will not be allowed to create
         or modify them. VMFS-3 file systems will not be accessible from
         ESX 2.x hosts.

         The -S option sets the label of the VMFS file system, and can only
         be used in conjunction with the ´-C´ option. This label can then
         be used to specify a VMFS file system in subsequent vmkfstools
         commands or in a virtual machine configuration file. The label
         will also appear in a listing produced by ´ls -l /vmfs/volumes´
         as a symbolic link to the VMFS file system. VMFS labels can be up
         to 128 characters long. They cannot contain leading or trailing
         spaces. After creating the file system, the label can be changed
         using the command ´ln -sf /vmfs/volumes/<FS UUID>
         /vmfs/volumes/<New label>´.

     -Z, --extendfs extension-partition
         Extend an existing VMFS-3 file system with the specified head
         partition by adding another partition designated by
         ´extension-partition´. A VMFS-3 file system can have at most 32
         partitions. This option will not work on VMFS-2 file systems as
         they are read-only in ESX Server 3.

     -P, --queryfs
     -h, --human-readable
         List the attributes of a VMFS file system when used on any file or
         directory of a VMFS file system. It lists the VMFS version number,
         the number of partitions constituting the specified VMFS file
         system, the file system label (if any), file system UUID,
         available space, and a listing of the device names of all the
         partitions constituting the file system. If partitions backing
         VMFS file system go offline then the number of partitions and
         available space reported change accordingly. The ´h´ option
         causes sizes to be printed in human-readable format (such as 5k,
         12.1M, or 2.1G).

FILE SYSTEM UPGRADE OPTIONS
     VMFS-2 to VMFS-3 file system upgrade is a two step process. Before file
     system upgrade can begin the `vmfs2` and `vmfs3` drivers 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 com-
     pletes, the auxiliary file system driver, `fsaux`, must be unloaded and
     the `vmfs2` and `vmfs3` drivers reloaded. The second step of file system
     upgrade makes use of the `-u` option.

     -T, --tovmfs3
     -x, --upgradetype [zeroedthick|eagerzeroedthick|thin]
         Converts a VMFS-2 file system to VMFS-3 format, preserving all files
         on the file system. Only file systems with block size 8MB or less
         can be converted. The conversion is in-place and the auxiliary file
         system driver (`fsaux`) module must be loaded. ESX Server 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. The `-x
         thin` option results in the conversion of VMFS-2 files into
         thin-provisioned VMFS-3 files (as opposed to thick-provisioned
         files). File blocks that are part of a ´thick´ file, but were
         never written to, are discarded from the file to enable storage
         overcommitment.  The default upgrade option, `-x zeroedthick`,
         retains the properties of ´thick´ files across the upgrade.
         The `-x eagerzeroedthick` option eagerly zeroes out previously
         unwritten blocks. Note that the upgrade process may run much longer
         when invoked with the `-x eagerzeroedthick` option, as opposed
         to the other two options.

     -u, --upgradefinish /vmfs/volumes/<file system label|file system UUID>
         Once the first step of file system upgrade has completed (using
         `-T`), the `vmfs2` and `vmfs3` modules must be reloaded and
         the `-u` option used to complete the upgrade.

VIRTUAL DISK OPTIONS
     -c, --createvirtualdisk #[gGmMkK]
     -a, --adaptertype [buslogic|lsilogic] srcFile
     -d, --diskformat [zeroedthick|eagerzeroedthick|thick|thin]
         Create a virtual disk with the specified size on the VMFS file
         system. The size is specified in bytes by default, but can be
         specified in kilobytes, megabytes or gigabytes by adding a suffix
         of ´k´, ´m´, or ´g´ respectively. The ´adaptertype´ option
         allows users to indicate which device driver should be used to
         communicate with the virtual disk. See the `SUPPORTED DISK
         FORMATS` section for details on the disk formats supported by
         the ´-d´ option. The default disk format is ´zeroedthick´. The
         `-d eagerzeroedthick` option is used to create `thick` virtual
         disk with zeroed out contents.

     -U, --deletevirtualdisk
         Delete files associated with the specified virtual disk.

     -E, --renamevirtualdisk srcDisk
         Rename files associated with a specified virtual disk to the
         specified name.
:

     -i, --clonevirtualdisk srcDisk
     -d, --diskformat [rdm:<device>|rdmp:<device>|raw:<device>|thin|2gbsparse]
         Create a copy of a virtual disk or raw disk. The copy will be in
         the specified disk format. See the `SUPPORTED DISK FORMATS´
         section for details on the disk formats supported by the ´-d´
         option. To clone ESX REDO logs while preserving their hierarchy, use
         the Service Console command ´cp(1)´.

     -e, --exportvirtualdisk dstDisk
         This operation is deprecated. Use ´-i srcDisk -d 2gbsparse´ to
         achieve what it used to.

     -X, --extendvirtualdisk #[gGmMkK]
         Extend the specified VMFS virtual disk to the specified length. This
         command is useful for extending the size of a virtual disk
         allocated to a virtual machine after the virtual machine has been
         created. However, this command requires that the guest operating
         system has some capability for recognizing the new size of the
         virtual disk and taking advantage of this new size (e.g. by
         updating the file system on the virtual disk to take advantage of
         the extra space).

     -M, --migratevirtualdisk
         Migrate an ESX2 virtual disk to an ESX3 virtual disk.

     -r, --createrdm /vmfs/devices/disks/...
         Map a raw disk to a file on a VMFS file system. Once the mapping
         is established, it can be used to access the raw disk like a
         normal VMFS virtual disk. The ´file length´ of the mapping is
         the same as the size of the raw disk that it points to.

     -q, --queryrdm
         List the attributes of a raw disk mapping. When used with a
         ´rdm:<device>´ or ´raw:<device>´ specification, it prints out the
         vmhba name of the raw disk corresponding to the mapping
         referenced by the <device>. It also prints out identification
         information for the raw disk (if any).

     -z, --createrdmpassthru /vmfs/devices/disks/...
         Map a passthrough raw disk to a file on a VMFS file system. This
         allows a virtual machine to bypass the VMKernel SCSI command
         filtering layer done for VMFS virtual disks. Once the mapping is
         established, it can be used to access the passthrough raw disk
         like a normal VMFS virtual disk.

     -Q, --createrawdevice /vmfs/devices/generic/...
         Create a raw device descriptor file on a VMFS file system. This
         should only be used for generic SCSI devices like tape drives.

     -v, --verbose #
         This option is ignored for the queryrdm option. Setting the
:
        verbosity level will list additional information for the virtual disk
         configuration.

     -g, --geometry
         Get the geometry information (cylinders, heads, sectors) of a
         virtual disk.

     -w, --writezeros
         Initialize the virtual disk with zeros. Any existing data on virtual
         disk is lost.

     -j, --inflatedisk
         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.

SUPPORTED DISK FORMATS
     These are the arguments that can be passed to the ´-d´ option for the
     ´-c´ (create virtual disk) and ´-i´ (clone virtual disk) operations.

     `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.

     `rdm`
         Virtual compatibility mode raw disk mapping.

     `rdmp`
         Physical compatibility mode (pass-through) raw disk mapping.

     `raw`
         Raw device.

     `2gbsparse`
         A sparse disk with 2GB maximum extent size. Disks in this format
         can be used with other VMware products.

:
     -s, --scan adapterName
         Scan a specified adapter for devices and/or LUNs. This option is
         especially useful for adapters which are connected to storage area
         networks (SANs). If a new device or LUN becomes accessible via the
         adapter, ESX Server will register this new device or LUN and
         make it usable by virtual machines. If an existing device or LUN
         is not being used and now appears to be gone, it will be removed from
         ESX Server data structures and will no longer be accessible to
         virtual machines.

     -L, --lock [reserve|release|lunreset|targetreset|busreset] /vmfs/devices/disks/...
         Manage SCSI reservations on physical targets or LUNs. These
         commands can interrupt the operations of other servers on a storage
         area network (SAN), so they should be used with great caution. The
         `reserve` command will reserve the specified raw disk.
         After the reservation, other servers will get a SCSI reservation
         conflict if they attempt to access that disk, but the server that did
         the reservation will be able to access the disk normally. The
         `release` command will release the reservation on the specified
         disk. Other servers will be able to access the disk again. The
         `lunreset` command resets a single LUN only instead of all
         the LUNs attached to a target. The `targetreset`  and `busreset`
         command will reset target and bus respectively causing SCSI
         reservations to be dropped. This option is potentially disruptive to
         all servers sharing the storage and is only meant to be used
         in the context of Clustering.


EXAMPLES
     vmkfstools -C vmfs3 -b 1m -S myVMFS vmhba1:3:0:1

     Creates a new VMFS-3 file system with label `myVMFS` on the 1st partition
     of target 3 and LUN 0 of vmhba adapter 1. The file block size is 1MB.

     vmkfstools -Z vmhba0:1:2:4 vmhba1:3:0:1

     Extends the newly created file system by adding the 4th partition of tar-
     get 1 and LUN 2 of vmhba adapter 0. As a result, the file system will
     span two partitions - vmhba1:3:0:1 and vmhba0:1:2:4. Here, vmhba1:3:0:1
     is the name of the head partition of the file system that is to be
     extended.

     vmkfstools -c 2048m /vmfs/volumes/myVMFS/myOS.vmdk

     Creates a 2GB VMFS virtual disk with the name `myOS.vmdk` on the VMFS
     file system named `myVMFS`. This virtual disk may then be accessed by a
     virtual machine.

     vmkfstools -i /vmfs/volumes/templates/gold-master.vmdk /vmfs/vol-
     umes/myVMFS/myOS.vmdk

     Clones the contents of a gold master virtual disk image from a template
     repository to a virtual disk named `myOS.vmdk` on the VMFS file system
     called myVMFS. A virtual machine can be configured to use this virtual
     disk by adding the following lines to its configuration file:

       scsi0:0.present = TRUE
       scsi0:0.fileName = /vmfs/volumes/myVMFS/myOS.vmdk

     vmkfstools -r /vmfs/devices/disks/vmhbaX:Y:Z:0 foo-rdm.vmdk

     Creates a mapping file, `foo-rdm.vmdk`, to the raw disk `vmhbaX:Y:Z:0`.
     The mapping file `foo-rdm.vmdk` is created in the current VMFS working
     directory, and can be used in a virtual machine in the same manner as in
     the previous example.

     vmkfstools -s vmhba1

     Scan adapter vmhba1 for any new targets or LUNs and for any removed tar-
     gets or LUNs.

VMnix                            May 11, 2006                            VMnix
Categories: VMWare Tags: , ,

Importing a VM from VM Workstation to ESX / ESXi

January 28th, 2011 No comments

Importing and exporting virtual machine from a VMWare ESX Server host requires converting that virtual machine’s .vmdk file(s) from one format to another.
Although the underlying technologies work the same, the formatting of the VMDKs differ.

You have 2 options:
1) If you have a running copy of workstation, simply use VMware Converter as you would for any normal conversion, treating the VM as you normally would a physical host in a P2V
2) If you have no working Workstation, you can clone / convert the vmdk at the command line – as I have a fully ESXi lab to play in, I don’t have Workstation running on any machines in my office – as such, when IBM recently supplied a VM for a demo . . that had been created on VM workstation, I had to import it. I used the following process.

Firstly, get hold of an SSH tool ( I use putty)

Next, open a connection to any host that has the storage containing the vmdk presented

In ESX / ESXi, this will be in /vmfs/volumes/<datastorename>

Note: the destination path /dest/folder/vmserver1.vmdk should not contain any existing files with the name ‘vmserver1.vmdk’. If it does the file will be overwritten.

Importing Virtual Disks from GSX Server and Workstation to ESX Server

Before an ESX Server can run a virtual machine created on a different version of VMWare, the virtual disks must first be converted to a format that can be read by the VMFS file system. This is done by running the following vmkfstools command:

vmkfstools -i <folder>/<filename>.vmdk <vmhba number>:<filename>.dsk

<folder> is the name of the folder from which you are importing from

<filename> is the name of the virtual machine file(s) to be imported

<vmhba number> is the name of the VMFS partition you are importing to

An example of a complete command would be:

vmkfstools -i /vmfs/volumes/CLRLAB001T1/vmserver1.vmdk /vmfs/volumes/CLRLAB001T1/vmserver1_new.vmdk

Additional information regarding the vmkfstools command can be found in the ESX Server documentation.

Categories: Toolbox, VMWare Tags: , ,

Connection issues to ESX host (ESX host not responding)

January 26th, 2011 No comments

First thing you should always do when you can’t connect to – or if there is an issue with your connection between vCenter and ESXi \ ESX is to:

1) check DNS configuration on the ESXi server and your DNS server that ESX points to making sure you have the appropriate entries
2) Check host files etc in /etc/hosts, /etc/resolve.conf, /etc/sysconfig/network and /etc/vmware/esx.conf files
2) try to disconnect and reconnect your ESXi host from your vCenter inventory, this uninstalls and reinstalls the vCenter agent using FQDN and then with IP address if FQDN didn’t work
3) Try Restarting both the vCenter management agent on the ESX host and the ESX host management agent. Learn how to do this here: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003490
4) If the above didn’t do anything for you, it could be lost connectivity to a LUN, which can cause problems with ESX (less now than earlier versions ESX 2.x), connect to ESXi host directly with VI Client and perform a rescan of your storage adaptors and LUNs.

Categories: VMWare Tags: , ,

VCP4 and VCAP-Datacentre Administration blueprints

January 21st, 2011 No comments

VCAP-DCA and VCP4 exam blueprint links

When I was studying for my VCP4, I stumbled across a ‘blueprint’

Simon Long basically collated as much information as was available on the web for the VCP4 exam, and has since continued updating the links on his page to point to the documentation for vSphere 4.1.
Simon has also started working on a VCAP-DCA.

Here’s the link for Simon’s VCP and VCAP-DCA pages:
http://www.simonlong.co.uk/blog/vcp-vsphere-upgrade-study-notes/
http://www.simonlong.co.uk/blog/vcap4-dca-study-notes/

In addition, Kendrick Coleman has also published a version of the VCAP-DCA exam blueprint over at http://kendrickcoleman.com/index.php?/Tech-Blog/vcap-datacenter-administration-exam-landing-page-vdca410.html
– a collection of links to the key technologies and documents covered in the exam. It’s a pretty complete guide to what to study for these exams.

Lastly, Scott Vessey over at http://vmwaretraining.blogspot.com/ has created a blog post of beta exam review links (in additiona to all the other very useful resources that he normally churns up).

These three guys are all VERY active on the VM forums and really have brought a whole lot to the community. Please make sure to share anything new that you do find with them, and thanks them for their hard work.