Showing posts with label Virtualization. Show all posts
Showing posts with label Virtualization. Show all posts

Saturday, January 4, 2014

Using VHD snapshots with Windows Azure Virtual Machines

I often use Windows Azure Virtual Machines to create a test environment. A requirement of such a test environment is to be able to quickly take one or more snapshots of a virtual machine and selectively restore a given snapshot later. Unfortunately Windows Azure (IaaS) does not provide this functionality out of the box.
This is where I use the CloudXplorer tool.

1. Take a snapshot of the disk (while the VM is stopped)
2. Start the VM, make changes and perform tests. When you have completed the tests, shutdown the VM.
3. Use CloudXplorer to promote the snapshot after breaking the disk lease.

4. Use CloudXplorer to (re)acquire the lease.
You can now restart the VM in the state where the snapshot was taken.


Saturday, January 23, 2010

Using differencing disks with VirtualBox

When evaluating new software, you often need to setup an isolated environment using virtual machines. This can be a lot of work when you have to install the machines from scratch. To avoid this you can setup a base configuration (for instance a machine which already has SQL server and Visual Studio installed) and copy the hard disk when creating a new instance. The downside of this method is that you waste a lot of disk space. To avoid this most virtualization products such as VmWare, VirtualBox and Virtual PC use differencing disks. These are disks that store only the different sectors in regard to their base or parent disk.

Following procedure shows how to use differencing disks with VirtualBox:

  1. Build the base system.
    After installing the operating system, apply all necessary update and install the VirtualBox additions.
  2. Release the base disk
    Since the base disk will become ‘read-only’, it must be detached form all virtual machines.

    ReleaseDisc
  3. Make the base disk immutable
    Use the following command:
    VBoxManage modifyhd <disk file>  --type immutable


  4. Create a new system from the base disk
    When creating the new system attach the immutable base disk. A new differencing disk will be created.

    NewSystem

    NewDisc

  5. Turn off the autoreset feature of the differencing disk
    This is necessary since the content of a differencing disk will be destroyed when the virtual machine is started.
    Use the following command:
    VBoxManage modifyhd <differencing disk file> --autoreset false



If you want to start a new hierarchy from a differencing disk, you can use the ‘VBoxManage clonehd’ command to build the new base disk. Following figure shows an example:

 

diskgen