Merge pull request #449 from skriss/azure-restore-fix

azure: pass full snapshot name when restoring disk
pull/452/head
Andy Goldstein 2018-04-23 15:58:50 -04:00 committed by GitHub
commit 726d61fab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -64,6 +64,10 @@ type snapshotIdentifier struct {
name string
}
func (si *snapshotIdentifier) String() string {
return getComputeResourceName(si.subscription, si.resourceGroup, snapshotsResource, si.name)
}
func getConfig() map[string]string {
cfg := map[string]string{
azureClientIDKey: "",
@ -147,7 +151,7 @@ func (b *blockStore) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ s
Properties: &disk.Properties{
CreationData: &disk.CreationData{
CreateOption: disk.Copy,
SourceResourceID: &snapshotID,
SourceResourceID: stringPtr(snapshotIdentifier.String()),
},
AccountType: disk.StorageAccountTypes(volumeType),
},