change the disk_size unit to MB
(cherry picked from commit 8866411)
This commit is contained in:
parent
1d61fa430b
commit
d1a681d7aa
|
@ -251,7 +251,7 @@ func (vm *VirtualMachine) Configure(config *HardwareConfig) error {
|
|||
return err
|
||||
}
|
||||
|
||||
disk.CapacityInKB = convertGiBToKiB(config.DiskSize)
|
||||
disk.CapacityInKB = convertMiBToKiB(config.DiskSize)
|
||||
|
||||
confSpec.DeviceChange = []types.BaseVirtualDeviceConfigSpec{
|
||||
&types.VirtualDeviceConfigSpec{
|
||||
|
@ -427,7 +427,7 @@ func addDisk(_ *Driver, devices object.VirtualDeviceList, config *CreateConfig)
|
|||
ThinProvisioned: types.NewBool(config.DiskThinProvisioned),
|
||||
},
|
||||
},
|
||||
CapacityInKB: convertGiBToKiB(config.DiskSize),
|
||||
CapacityInKB: convertMiBToKiB(config.DiskSize),
|
||||
}
|
||||
|
||||
devices.AssignController(disk, controller)
|
||||
|
@ -540,8 +540,8 @@ func (vm *VirtualMachine) addDevice(device types.BaseVirtualDevice) error {
|
|||
return err
|
||||
}
|
||||
|
||||
func convertGiBToKiB(gib int64) int64 {
|
||||
return gib * 1024 * 1024
|
||||
func convertMiBToKiB(mib int64) int64 {
|
||||
return mib * 1024
|
||||
}
|
||||
|
||||
func (vm *VirtualMachine) AddConfigParams(params map[string]string) error {
|
||||
|
|
|
@ -32,7 +32,7 @@ func defaultConfig() map[string]interface{} {
|
|||
"ssh_password": "jetbrains",
|
||||
|
||||
"vm_name": commonT.NewVMName(),
|
||||
"disk_size": 2,
|
||||
"disk_size": 2048,
|
||||
|
||||
"communicator": "none", // do not start the VM without any bootable devices
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue