VM snapshot needs consolidation

When a snapshot didn’t commit properly, it can happen that the snapshot manager in the vCenter server shows no snapshot(s), but that there are still active delta files on the datastore. These ‘hidden’ snapshot can cause the datastore to run out of space.

To report these ‘hidden’ snapshots (prior vSphere 5), I created a script that searches all the datastores  for ‘*.delta’ files and reported them by mail.

In vSphere 5 you have a new feature that reports and make it possible to consolidate these  ‘hidden’ snapshot(s). In vSphere 5 you get  a warning ‘Virtual machine disks consolidation is needed’ when the virtual machine snapshot consolidation has failed.

image

The snapshot manager shows no snapshots but there are delta files present on the datastore(s).

imageimage

In the vCenter server on the Virtual Machines tab you can enable the field “Needs Consolidation” to filter all the VMs that needs consolidation.

image

To consolidate the snapshot, right-click the virtual machine and choose Snapshot Consolidate.

image

Confirm the consolidate

image

Check the datastore and all the delta files are consolidated

image

 

With PowerCLI you can use the following one liner to list all the VMs that needs consolidation (thanks to Luc Dekens ):

Get-VM | where {$_.ExtensionData.Runtime.consolidationNeeded} | Select Name 
 

[ad#banner]

Configure SQL Server Express 2008 R2 instance to host the vCloud Director database

This blog will explain how to configure the vCenter Server SQL Express 2008 R2 instance to host the vCloud Director database.  This can be handy when you have limited resources in your test environment. SQL Server Express 2008 R2  is not a supported database for vCloud Director.  For production environments check always first the VMware interoperability Matrix to know what’s supported .

image

Steps:

image

  • – Select “New Query”

image

  • The following script (from vCloud Director installation and configuration guide) creates a database named “vcloud” on the c-drive  and a special SQL user "vcloud” . Customize this script for your environment.
  • Paste this script in the “New Query” window”
    USE [master] 
    

    GO

    CREATE DATABASE [vcloud] ON PRIMARY

    (NAME = N’vcloud’, FILENAME = N’C:\vcloud.mdf’, SIZE = 100MB, FILEGROWTH = 10% )

    LOG ON

    (NAME = N’vcdb_log’, FILENAME = N’C:\vcloud.ldf’, SIZE = 1MB, FILEGROWTH = 10%)

    COLLATE Latin1_General_CS_AS

    GO

     

    USE [vcloud]

    GO

    ALTER DATABASE [vcloud] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

    ALTER DATABASE [vcloud] SET ALLOW_SNAPSHOT_ISOLATION ON;

    ALTER DATABASE [vcloud] SET READ_COMMITTED_SNAPSHOT ON WITH NO_WAIT;

    ALTER DATABASE [vcloud] SET MULTI_USER;

    GO

     

    USE [vcloud]

    GO

    CREATE LOGIN [vcloud] WITH PASSWORD = ‘vcloudpass’, DEFAULT_DATABASE =[vcloud], DEFAULT_LANGUAGE =[us_english],CHECK_POLICY=OFF

    GO

    CREATE USER [vcloud] for LOGIN [vcloud]

    GO

     

    USE [vcloud]

    GO

    sp_addrolemember [db_owner], [vcloud]

    GO

     

    • Execute the script (1)  and make sure it has executed successfully (2)

    image

    • Open Start – All Programs – Microsoft SQL Server 2008 R2 – Configuration Tools – SQL Server Configuration Manager
    • Expand the “SQL Server Network Configuration” (1)
    • Select TCP/IP (2) and open the properties

    image

    • In the IPALL section, select the TCP port and fill in “1433”

    image

    • Restart the SQL Server (VIM_SQLEXP) service

    image

    • Open the command prompt on the SQL Server and check if port 1433 is listening by using this command:
    netstat -an | find "1433"
    

    image

    • Configure vCloud Director and point to the SQL Express instance
    image

VMware ESXi 5 snapshot changes

In ESX(i) 3.x and 4.x snapshots files are default created in the virtual machine’s working directory (home directory). The working directory is the same directory as the were the virtual machine configuration (*.vmx) file is stored. 

snapshot-working basic esxi4

 

In this example a VM called “test” that has two disks (VMDK’s) placed on two datastores. The first disk is created on the VMFS01 datastore and the second disk is created on the VMFS02 datastore.  When a snapshot is created,  the VM “test”, the snapshot redolog (-delta.vmdk) files are place in the working directory (home directory). So the snapshots files are created on datastore VMFS01.

 

snapshot-working esxi4

 

In ESXi 5 the snapshot delta disks are stored in the same home folder as the base disk. On every disk a snapshot file is created.

snapshot-working esxi5

 

I have seen VMware ESX(i) 3.x and 4.x environments were only the working directory (home directory) is sized to store snapshot files . The other datastores didn’t have enough room for storing snapshot files.  So be sure before upgrading to vSphere 5 that all the datastores have enough free space to store snapshot files!

The snapshot location can changed in ESXi 5 but when performing a Storage vMotion, all the snapshot deltas will get migrated to the same folder as the VM’s base disk on the destination. 

Be sure to check this before upgrading to VMware vSphere 5!

 

More Information: