Archive for October 2012

Virtualisation Blogs

This website literally lists all the Virtualisation Blogs you could ever wish for. Your gateway to the VMware Universe

http://planet.vsphere-land.com/

Creating new VMDKs – What Mode should you use?

There are 3 Disk Modes within the hard disk options.

  • Independent – Persistent

Disks in persistent mode behave like conventional disks on your physical computer. All data written to a disk in persistent mode are written permanently to the disk. You can set a virtual disk to independent mode to exclude the disk from any snapshots taken of its virtual machine. Changes are immediately and permanently written to the disk, so they have high performance

  • Independent – Non-Persistent

Changes to disks in non-persistent mode are discarded when you power off or reset the virtual machine. With non-persistent mode, you can restart the virtual machine with a virtual disk in the same state every time. Changes to the disk are written to and read from a redo log file that is deleted when you power off or reset. You can set a virtual disk to independent mode to exclude the disk from any snapshots taken of its virtual machine.

  • Normal

In normal mode, disks are included in snapshots that you take of the virtual machine. If you do not want data on the disk to be recorded when you take a snapshot of the virtual machine, configure the disk to be independent.

How to shrink VMware VMDKs

Shrinking a Virtual Disk

Shrinking a virtual disk reclaims unused space in the virtual disk and reduces the amount of space the virtual disk occupies on the host.
Shrinking a disk is a two-step process. In the preparation step, VMware Tools reclaims all unused portions of disk partitions (such as deleted files) and prepares them for shrinking. This step takes place in the guest operating system.
In the shrink step, the VMware application reduces the size of the disk based on the disk space reclaimed during the preparation step. If the disk has empty space, this process reduces the amount of space the virtual disk occupies on the host drive. The shrink step takes place outside the virtual machine.

When can you not shrink a disk?

Shrinking disks is not allowed under the following circumstances:

  • The virtual machine is hosted on an ESX/ESXi server. ESX/ESXi Server can shrink the size of a virtual disk only when a virtual machine is exported. The space occupied by the virtual disk on the ESX/ESXi server, however, does not change.
  • You pre-allocated all the disk space to the virtual disk when you created it. Must be Thick provisioned drive for Shrinking
  • The virtual machine contains a snapshot.
  • The virtual machine is a linked clone or the parent of a linked clone.
  • The virtual disk is an independent disk in non-persistent mode.
  • The file system is a journaling file system, such as an ext4, xfs, or jfs file system.

Prerequisites

■  On Linux, Solaris, and FreeBSD guests, run VMware Tools as the root user to shrink virtual disks. If you shrink the virtual disk as a nonroot user, you cannot prepare to shrink the parts of the virtual disk that require root-level permissions.

■  On Windows guests, you must be logged in as a user with Administrator privileges to shrink virtual disks.

■  Verify that the host has free disk space equal to the size of the virtual disk you plan to shrink.

■  Verify that all your hard disks are thick or this will produce an error when you click Shrink

Procedure

  • Click the Shrink tab in the VMware Tools control panel.

 

  • If the disk cannot be shrunk, the tab shows a description of the reason.

  • Select the partitions to shrink and click Prepare to Shrink.

If you deselect some partitions, the whole disk still shrinks. The deselected partitions, however, are not wiped for shrinking, and the shrink process does not reduce the size of the virtual disk as much as it would with all partitions selected.
VMware Tools reclaims all unused portions of disk partitions (such as deleted files) and prepares them for shrinking. During this phase, you can still interact with the virtual machine

  • When a prompt to shrink disks appears, click Yes.

The virtual machine freezes while VMware Tools shrinks the disks. The shrinking process takes considerable time, depending on the size of the disk.

  • When a message box appears that confirms the process is complete, click OK

The Newer Compact Command

Some newer versions of VMware products include a Compact button or menu command, which performs the same function as the Shrink command. You can use the Compact command when the virtual machine is powered off. The shrinking process is much quicker when you use the Compact command.

Method 1 – Using VMware Converter to shrink or extend a disk

  • Install VMware Converter on the machine you want to convert
  • Start the VMware Converter Application
  • Select File > New > Convert Machine > Select Powered on Machine
  • Specify the Powered On Machine as Local Machine
  • Note, you can also select File > New > Convert Machine > VMware Infrastructure Virtual Machine if you want to shrink a VM which is powered off but you will need VMware Converter installed on another machine

  • Click Next

  • In Destination Type, select VMware Infrastructure Virtual Machine
  • Put in vCenter Server Name
  • Put in User Account
  • Put in Password
  • Click Next

  • Type a different name for your VM. You cannot use the same name
  • Select the same Resource Pool you use for the machine you want to convert
  • Click Next

  • Choose a destination Resource Pool or host
  • Click Next

  • Click Edit on Data to Copy

  • Select Advanced

  • Select Destination Layout
  • Select the disk you want to change the size of by clicking the drop down button and select Change Size

  • Click Next
  • You will reach the Summary Page
  • Click Finish and the following window will open and show you the running task

  • Power off the original VM
  • Power up the new cloned VM and check everything works ok
  • Delete the original VM

Best Practices for using VMware Converter

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1004588

User Profiles and configuring Roaming Profiles

Introduction:

This blog post contains a high-level overview of different types of profiles, considerations for choosing a profile solution for your deployment, highlights of new profile features in Windows Server 2008 R2, and a best practices recommendation for deploying roaming user profiles with folder redirection in a Remote Desktop Services environment.

Terminology

Below are some basic definitions for background understanding of different types of profiles and folder redirection.

Local user profiles

A local user profile is created the first time a user logs on to a computer. The profile is stored on the computer’s local hard disk. Changes made to the local user profile are specific to the user and to the computer on which the changes are made.

Roaming user profiles

A roaming user profile is a copy of the local profile that is copied to, and stored on, a server share. This profile is downloaded to each computer a user logs onto on a network. Changes made to a roaming user profile are synchronized with the server copy of the profile when the user logs off. The advantage of roaming user profiles is that users do not need to create a profile on each computer they use on a network.

Mandatory user profiles

A mandatory user profile is a type of profile that administrators can use to specify settings for users. Only system administrators can make changes to mandatory user profiles. Changes made by users to desktop settings are lost when the user logs off. Mandatory profiles can be created from roaming or local profiles.

Temporary User Profiles

A temporary user profile is issued each time an error condition prevents the user’s profile from loading. Temporary profiles are deleted at the end of each session, and changes made by the user to desktop settings and files are lost when the user logs off. Temporary profiles are only available on computers running Windows 2000 and later.

Folder Redirection

Folder redirection is a client-side technology that provides the ability to change the target location of predetermined folders found within the user profile. This redirection is transparent to the user and gives the user a consistent way of saving their data, regardless of its storage location. Folder redirection provides a way for administrators to divide user data from profile data. This division of user data decreases user logon times because Windows downloads less data. Windows redirects the local folder to a central location, giving the user immediate access to their data when they save it, regardless of the computer they are using. This immediate access removes the need to update the user profile.

There are two primary benefits to Folder Redirection as it applies to profile data:

  1. When used with roaming profiles, it can significantly reduce the size of the portable profile data carried around by users for logon/logoff. Since these folders are redirected to network shares, you trade local I/O impact for network/remote I/O impact. This can be very helpful on disk-constrained deployments.
  2. Using Folder Redirection with mandatory profiles allows users to have some control/persistence of customization such as application configuration settings (AppData) or IE Favorites.

Useful Links

  • Managing Roaming User Data Deployment Guide

http://go.microsoft.com/fwlink/?LinkId=73760

  • User Profiles on Windows Server 2008 R2 Remote Desktop Services

http://blogs.msdn.com/b/rds/archive/2009/06/02/user-profiles-on-windows-server-2008-r2-remote-desktop-services.aspx

 

Shrinking a Windows Server 2008 R2 Partition Using Disk Management

The partitions on a Windows disk may be shrunk to a smaller size using the Disk Management snap-in or from the command prompt using the diskpart tool.

The snap-in can be accessed either from

  • The Server Manager or Computer Management tools. To launch the Server Manager open the Start menu and click on the Server Manager option, or click on the Server Manager icon in the task bar.
  • Alternatively launch Computer Management from Start -> All Programs -> Administration Tools -> Computer Management or run compmgmt.csc.
Within Disk Management right click on the volume to that needs to be resized and select Shrink Volume… from the popup menu to invoke the Shrink dialog as shown below:
If the “Shrink Volume” menu option is disabled it is likely that the volume is formatted with a FAT based file system and, as such, cannot be reduced in size using these techniques.Specify the amount by which the volume is to shrink and click on the Shrink button to initiate the resize

What happens to VMware Hosts in the event of a complete loss of SAN/Storage?

The Situation

Although IT infrastructure generally always adheres to N+1 technology, there may always be a situation where the “Worst Case Scenario” presents itself. I was asked the question today regarding the possibility and outcome of our SAN rebooting on the VMware Hosts. This was due to a Change Request entered on the system for a SAN firmware upgrade which stated the SAN would need to be rebooted if the change failed. Admittedly there wasn’t too much of a risk due to the fact they upgrade one node at a time and everything still runs on the other node. However what would happen if we lost all nodes?

The Consequences

This is indeed worse case scenario however if the SAN did crash and reboot, you would get an All-Paths-Down (APD) situation to your VMware hosts.

In vSphere 4.x, an All-Paths-Down (APD) situation occurs when all paths to a device are down. As there is no indication whether this is a permanent or temporary device loss, the ESXi host keeps reattempting to establish connectivity. APD-style situations commonly occur when the LUN is incorrectly unpresented from the ESXi/ESX host (which would be this case). The ESXi/ESX host, still believing the device is available, retries all SCSI commands indefinitely. This has an impact on the management agents, as their commands are not responded to until the device is again accessible.
This causes the ESXi/ESX host to become inaccessible/not-responding in vCenter Server.
It is difficult to say whether you would be able to recover all your devices and if there any corruption on the SAN side until everything is restored.

When the storage is back and running, I would recommend:

  • Completing a rescan of all the VM HBAs from the ssh console to try bring the paths back online.

esxcfg-rescan vmhba#

Where <vmkernel SCSI adapter name> is the vmhba# to be rescanned.

  • Restart management agents on the host
  • If you still cannot see the SAN you will need to complete a reboot of the hosts.