Github user syed commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1600#discussion_r90676133
  
    --- Diff: 
plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/Xenserver625StorageProcessor.java
 ---
    @@ -538,7 +562,7 @@ public Answer backupSnapshot(final CopyCommand cmd) {
                         final String[] tmp = result.split("#");
                         snapshotBackupUuid = tmp[0];
                         physicalSize = Long.parseLong(tmp[1]);
    -                    finalPath = folder + File.separator + 
snapshotBackupUuid;
    +                    finalPath = folder + File.separator + 
snapshotBackupUuid + ".vhd";
    --- End diff --
    
    @abhinandanprateek @jburwell @rhtyd So I've looked at why I added that 
change. This was required for object store as secondary storage to work.
    
    Let's say you are creating a template from a snapshot in a standard 
scenario where you have NFS as secondary storage. Now the request for this will 
go to the SSVM. Without the extension, SSVM will try to guess the extension 
based on the hypervisor and invoke a different function for XenServer which is 
not ideal but works  see: 
`NfsSecondaryStorageResource.java:copySnapshotToTemplateFromNfsToNfsXenserver`  
However, if you want to backup to an object storage, it doesn't have this 
logic. It basically takes the install path as the source of truth see: 
`NfsSecondaryStorageResource.java:copyFromNfsToImage` Same thing when we create 
a volume from snapshot but this time the request goes to the hypervisor and it 
will add the `.vhd` extension if it doesn't find one see 
`XenServer625StorageProcessor:createVolumeFromSnapshot`  where it invokes the 
`getSnapshotUuid` to extract the UUID from the installpath. 
    
    So I've basically fixed the case where we use Object storage and want to 
backup the snapshot. Now, in the normal case where we have NFS as secondary 
storage, are the snapshot operations failing? My impression was that they were 
working correctly. 
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to