From 72d7e5e01d7998a6106b44ae6a68a33289b00ff1 Mon Sep 17 00:00:00 2001 From: Steve Kriss Date: Mon, 23 Apr 2018 12:43:24 -0700 Subject: [PATCH] azure: pass full snapshot name when restoring disk Signed-off-by: Steve Kriss --- pkg/cloudprovider/azure/block_store.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cloudprovider/azure/block_store.go b/pkg/cloudprovider/azure/block_store.go index f453456ab..0745066be 100644 --- a/pkg/cloudprovider/azure/block_store.go +++ b/pkg/cloudprovider/azure/block_store.go @@ -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), },