Fix disk name in Nova snapshot procedure

Description:
After instance name change, Create volume from disk snapshot fails in instance snapshot
procedure as length of disk name goes beyond 61 chars.
GCE resource name should be in format '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)'

Before change:
>>> len('vol-novasnap-inst-7b51c5e2-17a5-435a-a068-61326e6058c21496985304')
64

After change:
>>> len('vol-nsnap-inst-7b51c5e2-17a5-435a-a068-61326e6058c21496985304')
61

Change-Id: I4a21dd7e73c4d219ca7d6cbc5b2647634ffa43d8
This commit is contained in:
Sanket 2017-06-12 12:34:08 +05:30 committed by Sanket Sudake
parent d86cd042c3
commit f9af3a8d2b
1 changed files with 1 additions and 1 deletions

View File

@ -312,7 +312,7 @@ class GCEDriver(driver.ComputeDriver):
LOG.debug(
_LI("2. Temporarily stopped instance %s") % instance.uuid)
snapshot_name = 'novasnap-' + disk_name + time.strftime("%s")
snapshot_name = 'nsnap-' + disk_name + time.strftime("%s")
operation = gceutils.snapshot_disk(
compute, project, zone, boot_disk['name'], snapshot_name)
gceutils.wait_for_operation(compute, project, operation)