cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Likitha Shetty (JIRA)" <>
Subject [jira] [Resolved] (CLOUDSTACK-8405) [vCenter 5.5] Restore VM on a migrated VM results in the deletion of the data disk.
Date Mon, 27 Apr 2015 11:22:38 GMT


Likitha Shetty resolved CLOUDSTACK-8405.
    Resolution: Fixed

In case of vSphere 5.5, if VM restore is performed on a VM that has previously been migrated,
all data volumes associated with the VM will be deleted.

+Root Cause Analysis+
During VM restore, CS does the following sequentially-
1. Stop VM (if running).
2. Delete VM's Root volume.
3. Create new Root volume from base template.
4. Configure VM to use the new Root volume.
5. Start VM.

During step 2 of VM restore, CS does a cleanup of the existing ROOT volume and this cleanup
triggers a detach of the Root volume from the VM. And once the Root volume is detached, CS
changes ROOT volume's type from 'ROOT' to 'DATADISK'.
This change in volume type was introduced as part of CS's new capability to allow users to
attach and detach Root disks of a VM.

In case of VMware, while deleting a volume if the volume is not of type 'ROOT' and if there
is a VM by the name of the volume's path, then CS assumes that the VM is a template and that
a request is being made to destroy that template. And when that VM which CS assumes to be
a template is destroyed, every volume attached to that VM is destroyed.

Why is this issue seen only in vSphere 5.5?
- Starting 5.5, all volumes associated with a VM are named after the VM. For e.g. 'i-2-4-VM_1.vmdk'.
 And since CS destroys a VM only if it finds a VM by the volume's name, it only happens in
case of 5.5. 
Previously, volume names used to be UUIDs.

Why is the issue seen only in VMs that have been migrated at least once?
- When a VM is first created via CS, CS names the volumes associated with the VM. But once
a VM is migrated, vSphere renames every volume associated with the VM as per its conventions.
And as mentioned above, in case of 5.5, the volumes are renamed to start with the VM's name.

Detach all data disks before performing a VM restore.

> [vCenter 5.5] Restore VM on a migrated VM results in the deletion of the data disk.
> -----------------------------------------------------------------------------------
>                 Key: CLOUDSTACK-8405
>                 URL:
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: VMware
>            Reporter: Likitha Shetty
>            Assignee: Likitha Shetty
>            Priority: Critical
>             Fix For: Future
> +Steps to reproduce+
> 1. Deploy a CS setup with VMware 5.5 (two clusters with a host each).
> 2. Deploy a VM in cluster1 ( without any data disk).
> 3. Migrate the VM along with storage to cluster2.
> 4. Create a data disk and attach it to the VM.
> 5. Now Restore the VM.
> +Result+
> VM gets deleted from vCenter which results in the deletion of the data disk (data loss).

This message was sent by Atlassian JIRA

View raw message