mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-5659: Creation of vm from iso failing with wrong file format.
The agent was always creating a disk with image format vhdx, but the cloudstack management server defaults to image format vhd for hyperv. Updated the agent code to be consistent with what cs expects. All disks are now created with image format vhd.
This commit is contained in:
parent
6ad27d903b
commit
069f8aeed5
@ -229,7 +229,10 @@ namespace HypervResource
|
|||||||
{
|
{
|
||||||
VolumeObjectTO volume = disk.volumeObjectTO;
|
VolumeObjectTO volume = disk.volumeObjectTO;
|
||||||
PrimaryDataStoreTO primary = volume.primaryDataStore;
|
PrimaryDataStoreTO primary = volume.primaryDataStore;
|
||||||
|
if (!primary.isLocal)
|
||||||
|
{
|
||||||
Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password);
|
Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password);
|
||||||
|
}
|
||||||
string diskPath = Utils.NormalizePath(volume.FullFileName);
|
string diskPath = Utils.NormalizePath(volume.FullFileName);
|
||||||
wmiCallsV2.AttachDisk(vmName, diskPath, disk.diskSequence);
|
wmiCallsV2.AttachDisk(vmName, diskPath, disk.diskSequence);
|
||||||
result = true;
|
result = true;
|
||||||
@ -1144,7 +1147,7 @@ namespace HypervResource
|
|||||||
VolumeObjectTO volume = VolumeObjectTO.ParseJson(cmd.data);
|
VolumeObjectTO volume = VolumeObjectTO.ParseJson(cmd.data);
|
||||||
PrimaryDataStoreTO primary = volume.primaryDataStore;
|
PrimaryDataStoreTO primary = volume.primaryDataStore;
|
||||||
ulong volumeSize = volume.size;
|
ulong volumeSize = volume.size;
|
||||||
string volumeName = volume.name + ".vhdx";
|
string volumeName = volume.name + ".vhd";
|
||||||
string volumePath = null;
|
string volumePath = null;
|
||||||
|
|
||||||
if (primary.isLocal)
|
if (primary.isLocal)
|
||||||
|
|||||||
@ -1553,7 +1553,7 @@ namespace HypervResource
|
|||||||
// Is there a template we can use to fill in the settings?
|
// Is there a template we can use to fill in the settings?
|
||||||
var newVirtHDSettings = VirtualHardDiskSettingData.CreateInstance();
|
var newVirtHDSettings = VirtualHardDiskSettingData.CreateInstance();
|
||||||
newVirtHDSettings.LateBoundObject["Type"] = 3; // Dynamic
|
newVirtHDSettings.LateBoundObject["Type"] = 3; // Dynamic
|
||||||
newVirtHDSettings.LateBoundObject["Format"] = 3; // VHDX
|
newVirtHDSettings.LateBoundObject["Format"] = 2; // VHD
|
||||||
newVirtHDSettings.LateBoundObject["Path"] = Path;
|
newVirtHDSettings.LateBoundObject["Path"] = Path;
|
||||||
newVirtHDSettings.LateBoundObject["MaxInternalSize"] = MaxInternalSize;
|
newVirtHDSettings.LateBoundObject["MaxInternalSize"] = MaxInternalSize;
|
||||||
newVirtHDSettings.LateBoundObject["BlockSize"] = 0; // Use defaults
|
newVirtHDSettings.LateBoundObject["BlockSize"] = 0; // Use defaults
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user