Skip to content

Commit 1dfe4c1

Browse files
anshulgangwardevdeep
authored andcommitted
CLOUDSTACK-6289: fixed storage migration failing in case of hyper-v if there are multiple disks attached to VM
1 parent e644ac1 commit 1dfe4c1

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource

plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,8 +1099,7 @@ public void MigrateVolume(string vmName, string volume, string destination)
10991099
string[] rasds = null;
11001100
if (sasd != null)
11011101
{
1102-
rasds = new string[sasd.Length];
1103-
uint index = 0;
1102+
rasds = new string[1];
11041103
foreach (StorageAllocationSettingData item in sasd)
11051104
{
11061105
string vhdFileName = Path.GetFileNameWithoutExtension(item.HostResource[0]);
@@ -1109,9 +1108,9 @@ public void MigrateVolume(string vmName, string volume, string destination)
11091108
string newVhdPath = Path.Combine(destination, Path.GetFileName(item.HostResource[0]));
11101109
item.LateBoundObject["HostResource"] = new string[] { newVhdPath };
11111110
item.LateBoundObject["PoolId"] = "";
1111+
rasds[0] = item.LateBoundObject.GetText(System.Management.TextFormat.CimDtd20);
1112+
break;
11121113
}
1113-
1114-
rasds[index++] = item.LateBoundObject.GetText(System.Management.TextFormat.CimDtd20);
11151114
}
11161115
}
11171116

0 commit comments

Comments
 (0)