Uploaded image for project: 'CloudStack'
  1. CloudStack
  2. CLOUDSTACK-10128

Template from snapshot not merging vhd files



    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Management Server
    • Security Level: Public (Anyone can view this level - this is the default.)
    • None
    • Production environment running ACS,,
      XenServer 6.5
      Primary Storage NFS and ISCSI
      Fresh install running,, and 4.10


      If we have two or more snapshots of a ROOT disk and try to create a template from differencial snapshots, CloudStack not merging the vhd files on secondary storage.

      Steps to reproduce

      1. Create virtual machine - OK

      2. Create a manual snapshot from ROOT volume - OK
      The vhd of first snapshot (snapshot-base) is stored on secondary storage correctly

      [root@acs01 6]# ls -l /exports/secondary/snapshots/2/6/011a7650-a13f-4332-8c72-2428a002affc.vhd
      rw-rr- 1 root root 1767191040 Nov 1 12:12 /exports/secondary/snapshots/2/6/011a7650-a13f-4332-8c72-2428a002affc.vhd

      [root@acs01 6]# md5sum /exports/secondary/snapshots/2/6/011a7650-a13f-4332-8c72-2428a002affc.vhd
      240e5e424552d44b5d297895b064beee /exports/secondary/snapshots/2/6/011a7650-a13f-4332-8c72-2428a002affc.vhd

      3. Create a template from snapshot-base - OK

      [root@acs01 6]# ls -l /exports/secondary/template/tmpl/2/206/be3311d9-8e59-4240-968d-73d7a6eecfdd.vhd
      rw-rr- 1 root root 1767191040 Nov 1 12:17 /exports/secondary/template/tmpl/2/206/be3311d9-8e59-4240-968d-73d7a6eecfdd.vhd

      [root@acs01 6]# md5sum /exports/secondary/template/tmpl/2/206/be3311d9-8e59-4240-968d-73d7a6eecfdd.vhd
      240e5e424552d44b5d297895b064beee /exports/secondary/template/tmpl/2/206/be3311d9-8e59-4240-968d-73d7a6eecfdd.vhd

      This template from snapshot-base boot normally

      4. Create new file (1GB) on ROOT volume

      5. Create new snapshot (snapshot-diff) from ROOT volume - OK

      [root@acs01 6]# ls -l /exports/secondary/snapshots/2/6/
      total 2840056
      rw-rr- 1 root root 1767191040 Nov 1 12:12 011a7650-a13f-4332-8c72-2428a002affc.vhd <- snapshot-base
      rw-rr- 1 root root 1141019136 Nov 1 12:21 1503adaa-4f6e-4f9c-8d80-68663baa86b8.vhd <- snapshot-diff

      6. Create a template from second snapshot - NOK

      [root@acs01 6]# ls -lh /exports/secondary/template/tmpl/2/207/4c5c51a1-fcb4-4cc8-8f97-1664a63af262.vhd
      rw-rr- 1 root root 1141019136 Nov 1 12:30 /exports/secondary/template/tmpl/2/207/4c5c51a1-fcb4-4cc8-8f97-1664a63af262.vhd

      CloudStack not merging snapshot-base and snapshot-diff. Template from second snapshot is corrupted because is based just on differential vhd.

      Volume from snapshot work very well

      1. Create a volume from snapshot-diff - OK
      CloudStack merge two snapshots in one file

      [root@acs01 primary]# ls -l /exports/primary/70f1db23-cc59-4ec7-b8d4-ed036228593b.vhd
      rw-rr- 1 root root 2843030016 Nov 1 12:34 /exports/primary/70f1db23-cc59-4ec7-b8d4-ed036228593b.vhd

      2. Download the new volume to check vhd on secondary storage

      [root@acs01 9]# ls -l /exports/secondary/volumes/2/9/ec6e0f65-bb71-4c91-bac3-287cde2106b7.vhd
      rw-rr- 1 root root 2843030016 Nov 1 12:35 /exports/secondary/volumes/2/9/ec6e0f65-bb71-4c91-bac3-287cde2106b7.vhd

      We test on,, and 4.10. XenServer 6.5 with SP1 and XenServer 6.5 with all patches.

      A workaround is create a volume (data-disk) from latest snapshot, create new snapshot from data-disk and convert to template.


        Issue Links



              rafaelweingartner Rafael Weingärtner
              lotic Marcelo Lima
              0 Vote for this issue
              4 Start watching this issue