Skip to content

Commit

Permalink
Add more context on how VM updates can be performed online to avoid s…
Browse files Browse the repository at this point in the history
…top/start'ing the VM (#146)

* Add more context on how VM updates can be performed online to avoid halt/start'ing the host

* Fix the wording

* Fix the wording
  • Loading branch information
ddelnano authored Apr 30, 2021
1 parent 449bde3 commit fdc5224
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions docs/resources/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,29 @@ resource "xenorchestra_vm" "bar" {
* `template` - (Required) The ID of the VM template to create the new VM from.
* `cloud_config` - (Optional) The content of the cloud-init config to use
* `cloud_network_config` - (Optional) The content of the cloud-init network configuration for the VM (uses [version 1](https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v1.html))
* `cpus` - (Required) The number of CPUs the VM will have.
* `memory_max` - (Required) The amount of memory in bytes the VM will have.
* `cpus` - (Required) The number of CPUs the VM will have. Updates to this field will cause a stop and start of the VM if the new CPU value is greater than the max CPU value. This can be determined with the following command:
```
$ xo-cli xo.getAllObjects filter='json:{"id": "cf7b5d7d-3cd5-6b7c-5025-5c935c8cd0b8"}' | jq '.[].CPUs'
{
"max": 4,
"number": 2
}
# Updating the VM to use 3 CPUs would happen without stopping/starting the VM
# Updating the VM to use 5 CPUs would stop/start the VM
```
* `memory_max` - (Required) The amount of memory in bytes the VM will have. Updates to this field will cause a stop and start of the VM if the new `memory_max` value is greater than the dynamic memory max. This can be determined with the following command:
```
$ xo-cli xo.getAllObjects filter='json:{"id": "cf7b5d7d-3cd5-6b7c-5025-5c935c8cd0b8"}' | jq '.[].memory.dynamic'
[
2147483648, # memory dynamic min
4294967296 # memory dynamic max (4GB)
]
# Updating the VM to use 3GB of memory would happen without stopping/starting the VM
# Updating the VM to use 5GB of memory would stop/start the VM
```


* `high_availabililty` - (Optional) The restart priority for the VM. Possible values are `best-effort`, `restart` and empty string (no restarts on failure. Defaults to empty string.
* `auto_poweron` - (Optional) If the VM will automatically turn on. Defaults to `false`.
* `affinity_host` - (Optional) The preferred host you would like the VM to run on. If changed on an existing VM it will require a reboot for the VM to be rescheduled.
Expand Down

0 comments on commit fdc5224

Please sign in to comment.