Site icon CormacHogan.com

Migrating a VM with snapshots to/from VSAN

snapshotIn Virtual SAN 6.0, a new snapshot format was introduced called vsanSparse. This improves snapshot functionality by leveraging the new VirstoFS on-disk format used with VSAN 6.0. I had a question recently about what would happen if I migrated a VM with a traditional vmfsSparse/redo log type snapshot. The question was whether or not it would be converted to the new vsanSparse format. Similarly, what if a VM with a vsanSparse snapshot was migrated from VSAN to a traditional VMFS/NFS datastore? Would it also be converted between formats? I decided that the only way was to try it out.

Step 1: Create a VM with a snapshot on VSAN

Here is the content of the VM Home directory on VSAN. Note that there is no VMDKs for either the VM disk or the snapshot since these are separate objects on VSAN. However the snapshot descriptor file is present.

# ls

snap-mig-test-000001.vmdk            
snap-mig-test-Snapshot1.vmsn         
snap-mig-test.vmsd                   
snap-mig-test.vmx~
snap-mig-test-81ddc93b.vswp          
snap-mig-test.nvram                  
snap-mig-test.vmx                    
vmware.log

By examining the descriptor file, I can see that the object is of type vsanSparse.

# cat snap-mig-test-000001.vmdk
# Disk DescriptorFile
version=4
encoding="UTF-8"
CID=fffffffe
parentCID=fffffffe
isNativeSnapshot="no"
createType="vsanSparse"
parentFileNameHint="snap-mig-test.vmdk"
# Extent description
RW 83886080 VSANSPARSE "vsan://f252ae55-2577-c9f5-98b7-001517a69c72"

# The Disk Data Base
#DDB

ddb.longContentID = "2a09df088285d7363397fff4fffffffe"

Step 2: Migrate the VM and snapshot to NFS

At this point, with the VM powered on, I migrated the VM to an NFS v3 datastore. Once the migration completed, I once again took a look at the virtual machine home folder and the snapshot descriptor file. The first thing we notice is that there are files representing the VMDK and snapshot on NFS (-flat and -delta respectively), so there are extra files when compared to the listing from VSAN.

# ls

snap-mig-test-000001-delta.vmdk     
snap-mig-test-Snapshot1.vmsn        
snap-mig-test.vmsd                  
vmware.log
snap-mig-test-000001.vmdk           
snap-mig-test-flat.vmdk             
snap-mig-test.vmx                   
vmx-snap-mig-test-387547512-1.vswp
snap-mig-test-17198178.vswp         
snap-mig-test.nvram                 
snap-mig-test.vmx.lck
snap-mig-test-7ff75b0a.hlog        
snap-mig-test.vmdk                  
vmware-0.log

But now if the snapshot descriptor is examined, the snapshot type is vmfsSparse. So it has been converted by the Storage vMotion operation:

# cat snap-mig-test-000001.vmdk

# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=fffffffe
parentCID=fffffffe
isNativeSnapshot="no"
createType="vmfsSparse"
parentFileNameHint="snap-mig-test.vmdk"
# Extent description
RW 83886080 VMFSSPARSE "snap-mig-test-000001-delta.vmdk"

Step 3: Migrate the VM and snapshot back to VSAN

As a final test, I decided to move the VM and snapshot back to VSAN doing another Storage vMotion operation.

# ls

snap-mig-test-000001.vmdk            
snap-mig-test-Snapshot1.vmsn         
snap-mig-test.vmx                    
vmware.log
snap-mig-test-52c0ff49.vswp          
snap-mig-test.nvram                  
snap-mig-test.vmx.lck                
vmx-snap-mig-test-1388379977-1.vswp
snap-mig-test-52c0ff49.vswp.lck      
snap-mig-test.vmdk                   
snap-mig-test.vmx~
snap-mig-test-78214767.hlog          
snap-mig-test.vmsd                   
vmware-0.log

Once again, there is no -flat and -delta files and these are unique objects on VSAN and do not exist as files. There are some extra log files however, as you might expect. Now to see if the snapshot format was converted from vmfsSparse to vsanSparse when it was moved from NFS to the VSAN datastore:

# cat snap-mig-test-000001.vmdk

# Disk DescriptorFile
version=4
encoding="UTF-8"
CID=fffffffe
parentCID=fffffffe
isNativeSnapshot="no"
createType="vsanSparse"
parentFileNameHint="snap-mig-test.vmdk"
# Extent description
RW 83886080 VSANSPARSE "vsan://6a55ae55-5503-fffe-dcf6-001517a69c72"

# The Disk Data Base
#DDB

ddb.longContentID = "2a09df088285d7363397fff4fffffffe"

And the snapshot is back to a vsanSparse format. So as you can clearly see, the change in snapshot format when migrating a VM with snapshots between the different datastore types in happening on-the-fly.

One thing to keep in mind however is if the VM has an existing vmfsSparse format snapshot (say it was present when VSAN was upgraded from 5.5 to 6.0), then further snapshots of that VM will also be vmfsSparse. You will have to collapse all of the vmfsSparse snapshots first, and then any subsequent snapshots taken of the VM will be vsanSparse format.

More information on vsanSparse format snapshots can be found in this whitepaper.

Exit mobile version