Merge pull request #9932 from chrisroberts/e-hyperv-maxmem-chk
Validate maxmemory setting within Hyper-V provider
This commit is contained in:
commit
3919455f08
|
@ -368,6 +368,12 @@ function Set-VagrantVMMemory {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($DynamicMemory) {
|
if($DynamicMemory) {
|
||||||
|
if($MemoryMaximumBytes < $MemoryMinimumBytes) {
|
||||||
|
throw "Maximum memory value is less than required minimum memory value."
|
||||||
|
} else if ($MemoryMaximumBytes < $MemoryStartupBytes) {
|
||||||
|
throw "Maximum memory value is less than configured startup memory value."
|
||||||
|
}
|
||||||
|
|
||||||
Hyper-V\Set-VM -VM $VM -DynamicMemory
|
Hyper-V\Set-VM -VM $VM -DynamicMemory
|
||||||
Hyper-V\Set-VM -VM $VM -MemoryMinimumBytes $MemoryMinimumBytes -MemoryMaximumBytes `
|
Hyper-V\Set-VM -VM $VM -MemoryMinimumBytes $MemoryMinimumBytes -MemoryMaximumBytes `
|
||||||
$MemoryMaximumBytes -MemoryStartupBytes $MemoryStartupBytes
|
$MemoryMaximumBytes -MemoryStartupBytes $MemoryStartupBytes
|
||||||
|
|
Loading…
Reference in New Issue