Don't use volume name as snapshot name because volume name may incude space, \ and other special character, which cannot be part of path name in vmware

after this commit, snapshot name is volumeUuid_timestring.
This commit is contained in:
Anthony Xu 2013-05-29 15:10:49 -07:00
parent 3ae00f4b2f
commit a4d428434d
1 changed files with 1 additions and 6 deletions

View File

@ -1033,12 +1033,7 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
// Snapshot Name: VMInstancename + volumeName + timeString
String timeString = DateUtil.getDateDisplayString(DateUtil.GMT_TIMEZONE, new Date(), DateUtil.YYYYMMDD_FORMAT);
VMInstanceVO vmInstance = _vmDao.findById(volume.getInstanceId());
String vmDisplayName = "detached";
if (vmInstance != null) {
vmDisplayName = vmInstance.getHostName();
}
String snapshotName = vmDisplayName + "_" + volume.getName() + "_" + timeString;
String snapshotName = volume.getUuid() + "_" + timeString;
// Create the Snapshot object and save it so we can return it to the
// user