Saturday, December 24, 2011

Migrating virtual machines with Raw Device Mappings (RDMs)


Migrating virtual machines with Raw Device Mappings (RDMs)

Purpose

This article discusses some of the common questions that arise when migrating virtual machines that utilize Raw Device Mappings (RDMs). 
Migrating of virtual machines with RDMs can be performed in three ways:
  • Warm migration (vMotion) with the virtual machine powered on.
  • Cold migration with the virtual machine powered off.
  • Storage migration (Storage vMotion) with the virtual machine powered on. 

Resolution

vMotion

  • Files for a virtual machine are not relocated when it is vMotioned.
  • The virtual machine is re-registered to the destination host.
  • Any RDMs remain as RDMs when the virtual machine is registered to another host. That is, no changes to the virtual machine itself are made.

Cold Migration

With file relocation:
  • Any non-RDM virtual disks are physically moved to the destination.
  • The virtual machine configuration files are physically moved to the destination.
  • Raw LUNs themselves cannot be moved, as they are raw disks presented from the SAN. However the pointer files (RDMs) can be relocated if required.
  • When performing a cold migration of a virtual machine with RDMs attached to it, the contents of the raw LUN mapped by the RDM are copied into a new .vmdk file at the destination, effectively converting or cloning a raw LUN into a virtual disk. This also applies when the virtual machine is not moving between ESX hosts. In this process, your original raw LUN is left intact. However, the virtual machine no longer reads or writes to it. Instead, the newly-created virtual disk is used.
  • If you wish to cold migrate a virtual machine without cloning or converting its RDMs, remove them from the configuration of the virtual machine before migrating. You can delete the RDM from the disk when removing it (the raw LUN contents are not changed). Re-add them to the configuration when completed.
Without file relocation:
  • The virtual machine registration changes, but the files are left untouched.

Cloning

If you want to clone a virtual machine without its RDMs, remove them from the configuration of the virtual machine before migrating. You can delete the RDM from the disk when removing it (the raw LUN contents are not changed, only the RDM mapping file is deleted). Re-add them to the configuration when completed.

Storage vMotion

  • When you perform Storage vMotion, the virtual machine files are physically relocated to a destination datastore. The same host retains ownership or registration of the virtual machine after Storage vMotion completes.
  • For Virtual Infrastructure 3.5, Virtual Disks and Virtual and Physical Mode RDM pointer files can be relocated to the destination datastore but cannot be converted to thick-provisioned or thin-provisioned disks during migration.The RDM pointer files of the virtual machine remain as RDM pointer files when the process completes.
  • For vSphere 4.0 and higher, Virtual Disks and Virtual Mode RDM pointer files can be relocated to the destination datastore, and can be converted to thick-provisioned or thin-provisioned disks during migration as long as the destination is not an NFS datastore. Physical Mode RDM pointer files can be relocated to the destination datastore, but cannot be converted.
For instructions on using Storage vMotion, see Moving virtual machines with Storage vMotion (1005544)
This table summarizes the available options and requirements:
Storage vMotion (SvMotion)
VirtualCenter 2.5
vCenter Server  4.x
RDM virtual compatibility mode
RDM physical compatibility mode
Can the virtual machine change hosts?
Virtual machine Snapshots
ESX/ESXi 3.5
Supported using the remote CLI script:svmotion.pl.
Yes
YesYes
No
Virtual machine must not have snapshots while performing SvMotion.
ESX/ESXi 4.0 and higher
Not supported: VirtualCenter 2.5 cannot manage ESX/ESXi 4.0 and higher hosts.
Yes
Yes
Yes
Yes
Virtual machine must not have snapshots while performing SvMotion.

Note: Storage vMotion of virtual machines using virtual compatibility mode RDMs is supported, however clustered applications or clustered virtual machine configurations do not support Storage vMotion.
For information about the Storage vMotion CLI script, see:
For Storage vMotion requirements and limitations, see the Storage vMotion Requirements and Limitations section of theBasic System Administration Guide for your version of ESX.

Additional Information


Snapshots

Ensure that snapshots are committed before performing storage migrations, especially if you are removing mappings or disks from your virtual machine configuration and later re-adding them. During re-addition of the respective disk, the VMware Infrastructure or vSphere Client does not allow you to re-select a specific (the previous) snapshot level or .vmdkfile to add back to the virtual machine configuration.

Block size and capacity limitations of your destination datastore

Raw Device Mappings occasionally represent large raw LUNs. If you clone virtual machine with an RDM still attached, the contents of the raw LUN mapped by the RDM are copied into a new virtual disk (.vmdk) file at the destination. Converting a RDM into a virtual disk (.vmdk) file does not succeed if your destination or target datastore does not have the capability of storing single contiguous files as large as the raw LUN. Large virtual disks have the same requirements or constraints.

For example, if your destination datastore is VMFS 3 created with a 2 MB block size and the RDM or virtual disk being converted or migrated is 640 GB, the process fails. A VMFS 3 block size of 4 MB or higher is required so you can store files larger than 512 GB. For more information, see Block size limitations of a VMFS datastore (1003565).

Tags

migrate-vm

See Also

Wednesday, December 14, 2011

vCenter Server Installation On Windows 7


Warning: This hacking is not supported by VMware !!!
1. extract iso image of vCenter (e.g. in 7zip or in WinRar) to any folder in destination machine
2. Download the Msi Editor application for editing msi file and install
3. run this application and open file …\vpx\VMware vCenter Server.msi
4. in Tables click on item “LaunchCondition”
5. on the right find row with text:
“Installed Or (VersionNT>=501 And VersionNT < 600) Or (VersionNT = 600 And MsiNTProductType <> 1) Or (VersionNT = 601 And MsiNTProductType = 3)”
and modify it to:
“Installed Or (VersionNT>=501) Or (VersionNT = 600 And MsiNTProductType <> 1) Or (VersionNT = 601 And MsiNTProductType = 3)”
after that save and close
6. download 64-bit verison of Microsoft AD LDS (new name for ADAM) from:
Windows Vista:
Windows 7:
and install
7. run ..\autorun.exe to install vCenter
Cheers

Sunday, October 9, 2011

Studying for the VCP5 exam

Even though the VCP5 exam is only 5 weeks old at the time of writing, there are some amazing resources already available to help with those preparing for the exam.

I've always been an advocate of trying to prepare yourself using the official resources that VMware make available - the exam blueprint tells you what aspects of vSphere 5 you will get tested on, the exam format, number of questions, time limit, and the scoring system. The exam blueprint makes references to the official vSphere 5 documentation, which VMware validate the exam items against, and the mock exam gives a decent indication of the exam format. The VCP community forum is an excellent way of asking VCP5-related questions and getting furter information.
VCP5 homepage
VCP5 exam blueprint
VCP5 mock exam
VCP community forum
vSphere 5 documentation

Something that VMware don't publish is an expanded exam blueprint that includes all the relevant study notes, however there are a number of sites where people have done exactly that - be careful when using these study notes in case they're not accurate in comparison to the official documentation.
Forbes Guthrie's vReference documentation notes for vSphere 5
Prep Guide for VCP5.0
Andre Mauro's vInfrastructure VCP5 notes

There are a number of people in the VMware community that write and publish their own practice questions, normally as part of their own preparations - it should be noted that these do not necessarily indicate the types and styles of questions you will get in the real exam, and the accuracy of these practice exams cannot be guaranteed either.
Robert Stothard's VCP5 practice questions
Simon Long's VCP5 practice exams
Paul McSharry's VCP5 practice questions

To finish, here are a couple of exam experience blog posts from people that have taken the exam themselves - I'll post my own review once I've taken the exam myself!
Eric Sloof's VCP5 exam experience
Brian Tobia's VCP5 exam thoughts and experience

Best of luck....!

Wednesday, September 28, 2011

VLAN Configuration on Virtual Switch, Physical Switch, and Virtual Machines


VLAN Configuration on Virtual Switch, Physical Switch, and Virtual Machines

Purpose


This article describes the various VLAN tagging methods used with ESX/ESXi.
Virtual LAN (VLAN) implementation is recommended in ESX/ESXi networking environments because:
  • It integrates ESX/ESXi into a pre-existing network
  • It secures network traffic
  • It reduces network traffic congestion
  • iSCSI traffic requires isolated network

Resolution


There are three methods of VLAN tagging that can be configured on ESXi:
  • External Switch Tagging (EST)
  • Virtual Switch Tagging (VST)
  • Virtual Guest Tagging (VGT)

External Switch Tagging

Virtual Switch Tagging

  • All VLAN tagging of packets is performed by the virtual switch before leaving the ESX/ESXi host.
  • The ESX host network adapters must be connected to trunk ports on the physical switch.
  • The portgroups connected to the virtual switch must have an appropriate VLAN ID specified.
  • For more information, see Configuring a VLAN on a portgroup (1003825).
  • See the following example snippet of code from a Cisco switch port configuration:switchport trunk encapsulation dot1q
    switchport mode trunk
    switchport trunk allowed vlan x,y,zspanning-tree portfast trunk
Note: The Native VLAN is not tagged and thus requires no VLAN ID to be set on the ESX/ESXi portgroup.

Virtual Guest Tagging

  • All VLAN tagging is performed by the virtual machine.
  • You must install an 802.1Q VLAN trunking driver inside the virtual machine.
  • VLAN tags are preserved between the virtual machine networking stack and external switch when frames are passed to/from virtual switches.
  • Physical switch ports are set to trunk port.
  • For more information, see Sample configuration of virtual machine VLAN tagging (VGT Mode) (1004252).
  • See this example snippet of code from a Cisco switch port configuration:switchport trunk encapsulation dot1q
    switchport mode trunk
    switchport trunk allowed vlan x,y,zspanning-tree portfast trunk

Thursday, September 22, 2011

Using vSphere Management Assistant(vMA) to collect ESX and ESXi logs


Purpose

The VMware vSphere Management Assistant (vMA) can be configured to accept logs from your ESX and ESXi host. For more information about downloading, installing, and configuring vMA, see the vSphere Management Assistant Documentation.

Resolution

Configuring your VMware vSphere Management Assistant (vMA) appliance to collect the logs from an ESX/ESXi host:
  1. Run this command to add the ESX/ESXi host to the vMA appliance:

    # sudo vifp addserver [ESX/ESXi IP or HOSTNAME]

    You are prompted for the root password for the target system.
  2. Run this command to view the list of ESX/ESXi hosts connected to the vMA appliance.

    # sudo vifp listservers

  3. Run this command to enable the vilogger interface and to configure vMA to collect log files from the target ESX/ESXi or vCenter Server hosts according to the specified log policy:
    # vilogger enable --server [ESX/ESXi IP or HOSTNAME] --numrotation <ROTATION: 1 to 1024> --maxfilesize <SIZE in MB: 1 to 1024> --collectionperiod <PERIOD in seconds: 10 to 3600>
    Where is the ESX/ESXi IP or HOSTNAME  is the IP address or hostname of the ESX/ESXi host.

    For example, the command with default values is:

    # vilogger enable --server [ESX/ESXi IP or HOSTNAME] --numrotation 5 --maxfilesize 5 --collectionperiod 10

In the vMA 4.x versions, the logs are located at /var/log/vmware. In earlier vMA versions, the logs are located at /var/log/syslog. 
Each host managed by the vMA appliance has a subdirectory within /var/log/vmware. Each of these subdirectories, in turn, contains the log files, such as hostd.log, messages.log, vmkernel.log, vmkwarning.log, and vpxa.log.

To read the log files, you can use commands such as tail -f. For example, to read the contents of the vpxa.log file, run this command:
# tail -f /var/log/vmware/<FQDN of Host>/vpxa.log
To customize the options for the vilogger command, see the vilogger Daemon and Log Management Commands section of the vSphere Management Assistant Guide.

Additional Information

The syntax of the vilogger command is:

vilogger <command>
Where <command> can be one of the following:
  • enable         [--server <SERVER>]
                   [--logname <LOGNAME>]
                   [--collectionperiod <PERIOD in seconds: 10 to 3600>]
                   [--numrotation <ROTATION: 1 to 1024>]
                   [--maxfilesize <SIZE in MB: 1 to 1024>]

        
  • disable        [--server <SERVER>]
                   [--logname <LOGNAME>]
                   [--force]
  • list           [--server <SERVER>]
                   [--logname <LOGNAME>]
  • updatepolicy   [--server <SERVER>]
                   [--logname <LOGNAME>]
                   [--collectionperiod <PERIOD in seconds: 10 to 3600>]
                   [--numrotation <ROTATION: 1 to 1024>]
                   [--maxfilesize <SIZE in MB: 1 to 1024>]

           
  • help | --help | -h  [<command name>]
To increase disk space on an installed vMA appliance refer to How to increase/resize vMA Disks.