VMwareEsxVmdkDriver: clone ends up corrupting data in case of vSAN datastore

Bug #1233034 reported by Kartik Bommepally on 2013-09-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kartik Bommepally

Bug Description

VMwareEsxVmdkDriver treats VMDK files as regular files at the time of cloning.
It does the clone by simply copying the folder containing the files.

This does not play well with a vSAN enabled ESX datastore, where the descriptor will get copied over, but the data file will still be shared with other source volume. The same is the issue with creating from snapshot point.

tags: added: vmdk vmware

Fix proposed to branch: master
Review: https://review.openstack.org/48915

Changed in cinder:
assignee: nobody → Kartik Bommepally (kartikaditya)
status: New → In Progress

Reviewed: https://review.openstack.org/48915
Committed: http://github.com/openstack/cinder/commit/fc7c36c9ca94de6bd2481c59d7710566dd4a1ddb
Submitter: Jenkins
Branch: master

commit fc7c36c9ca94de6bd2481c59d7710566dd4a1ddb
Author: Kartik Bommepally <email address hidden>
Date: Mon Sep 30 02:45:37 2013 -0700

    VMware ESX: Fixes vol clone & clone from snapshot

    The driver was earlier performing create from a source volume and create from
    a snapshot point by copying the source volume container folder.

    This is not valid in case of vSAN datastore where the volume data is not a
    'file' in the container folder unlike VMFS/NFS datastores. So copying folder
    will only copy descriptor file and hence the source and cloned volume will
    end up writing to the same data location, eventually corrupting it.

    The fix is to copy only the VMDK file (descriptor + data) and not the entire
    container folder. The implementation does the following:
    1. Create a volume backing
    2. Delete the current VMDK
    3. Make a copy of source volume's VMDK file to the destination using virtual
       disk manager. In case of create from snapshot, we copy the VMDK file
       corresponding to the snapshot point.

    Fixes bug: 1233034

    Change-Id: I51c9870c11a6d66f9f47c1ad9aaa2abc3dd0533a

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-10-04
Changed in cinder:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-rc1 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers