Wednesday, October 12, 2011

Add a Hard Disk to a Virtual Machine..............

When you add a hard disk to a virtual machine, you can create a new virtual disk, add an existing virtual disk, or add a mapped SAN LUN.

Procedure
  1.  In the vSphere Client inventory, right-click the virtual machine and select Edit Settings
  2.  Click the Hardware tab and click Add..
  3.  Select Hard Disk, and click Next.
  4.  Select the type of storage for the virtual machine’s disk, and click Next
You can store virtual machine data in a new virtual disk, an existing virtual disk, or a Mapped SAN LUN. A virtual disk, which appears as a single hard disk to the guest operating system, is composed of one or more files on the host file system. Virtual disks can easily be copied or moved on the same host or between hosts.
Options
Create a new virtual disk
  •   Enter the disk capacity.
  •  Select a thin disk format or a thick disk format to allow the disks to support clustering features.
  •  Select a location to store the disk. Store with the virtual machine or Specify a datastore.
  •  If you selected Specify a datastore, browse for the datastore location, and click Next.
Use an Existing Virtual Disk
  •  Browse for the disk file path and click Next.
Raw Device Mappings Gives your virtual machine direct access to SAN.
  •  Select the LUN that you want to use for the raw disk, and click Next.
  •  Select to store the LUN mapping files on the same datastore as the virtual machine files, or select a different a datastore, and click Next.
5. Select the compatibility mode.
  • Physical allows the guest operating system to access the hardware directly.
  • Virtual allows the virtual machine to use VMware snapshots and other advanced functions.
6. Click Next.
7. Accept the default or select a different virtual device node.

8. (Optional) Select the virtual disk Independent mode and select an option.

Persistent: The disk operates normally except that changes to the disk are permanent even if the virtual machine is reverted to a snapshot.

Nonpersistent: The disk appears to operate normally, but whenever the virtual machine is powered off or reverted to a snapshot, the contents of the disk return to their original state. All later changes are discarded.
Independent disks are not affected by snapshots.

9. Click Next.

10. Review the information, and click Finish.

That’s it... :)


Tuesday, October 11, 2011

Increasing the size of a virtual disk(VMware)

The procedure for increasing the size of a virtual disk slightly differs between VMware products. Here we are considering VMware workstation and player.
Before doing this, Make sure all snapshots have been removed and virtual machine is powered off.
To increase the virtual disk from command line, go to theVMware product installation dir and run this command,
C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager -x 100Gb "d:\VM Folder\vmdiskfile.vmdk", Replace 100Gb with the actual size of virtual disk that you want
This will take some time, and once complete the application will give you some sizing messages.
Now you need to expand the capacity of the disk to take advantage of its new size. If the disk is the system volume you will need to mount the disk in a second VM and expand it from there. If its not a system volume do it within the virtual machine it belongs to.
Once you've mounted the disk in a different VM or booted up the VM it belongs to if its not the system volume, do the following.
Go to the command line and start the diskpart utility. By issuing the following command.
diskpartOnce you've started diskpart, list the drives using the following command:
list diskThis will show you the disks assigned to your machine. Now the important command

list volumeThis will show you the drives, their volume number, capacity etc. You now need to select the volume you are about to expand, using the following command. Where n is equal to the number of the volume.select volume=nOnce selected, you can now expand it using the extend command. You can optionally specify the amount extend it by.extendThat's it.For Workstation 7 and later and Player 3.x and later, you can increase the virtual disk from the GUI:
Select the virtual machine from the Inventory.Click Edit Virtual Machine Settings.Click Hard Disk.Click Utilities > Expand, enter the new size, then click Expand.
Once you've extended the disk, it's wise to defrag the drive. If you use the defragment tool in VMWare workstation you will find it much quicker than deframenting the drive from within the machine.
Now use a third party utility to resize disk partitions.
Note: Windows Server 2008, Windows Vista, and Windows 7 can expand the volumes from the Disk Manager in Computer Management. Right-click on the volume and click Extend Volume................