mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-06-03 14:00:15 -04:00
Validate maxmemory setting within Hyper-V provider
Forces an error if maxmemory value is less than the configured minimum or startup memory. Fixes #9477
This commit is contained in:
parent
c7e35d655c
commit
9482f351fc
1 changed files with 6 additions and 0 deletions
|
|
@ -368,6 +368,12 @@ function Set-VagrantVMMemory {
|
|||
}
|
||||
|
||||
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 -MemoryMinimumBytes $MemoryMinimumBytes -MemoryMaximumBytes `
|
||||
$MemoryMaximumBytes -MemoryStartupBytes $MemoryStartupBytes
|
||||
|
|
|
|||
Loading…
Reference in a new issue