wiki-grav/pages/02.linux/xcp-ng/xe-cli/default.en.md

83 lines
1.4 KiB
Markdown
Raw Normal View History

---
2022-12-01 08:51:34 +01:00
title: "xe CLI"
visible: true
---
[toc]
2022-12-01 08:51:34 +01:00
## VM Operations
2022-12-01 08:51:34 +01:00
2023-02-19 16:01:08 +01:00
Show running VMs
2023-02-19 16:01:08 +01:00
```sh
xe vm-list --multiple power-state=running
```
Poweroff all VMs currently running
```sh
xe vm-shutdown --multiple power-state=running
```
Start VM
```sh
xe vm-start uuid={VM UUID}
```
## Host reboot procedure
2022-12-01 08:51:34 +01:00
2023-07-30 11:39:26 +02:00
Disable the host so that no new VM can be started on this host and so that the rest of the pool knows that the host was disabled on purpose.
From command line:
[shroot]
2023-07-30 11:39:26 +02:00
```sh
xe host-disable host=$(hostname)
2023-07-30 11:39:26 +02:00
```
2023-07-30 11:39:26 +02:00
[/shroot]
2023-07-30 11:39:26 +02:00
Migrate the VMs running on the host to other hosts in the pool, or shut them down.
2023-07-30 11:39:26 +02:00
Reboot or shutdown.
Can be done from XO, or from command line
[shroot]
```sh
xe host-reboot host=$(hostname)
```
[/shroot]
2023-07-30 11:39:26 +02:00
(After a reboot or host startup) Move VMs back to the host if appropriate. There is no need to re-enable the host: it is done automatically when it starts.
2023-02-19 16:01:08 +01:00
> [XCP-ng documentation](https://docs.xcp-ng.org/guides/host-reboot/)
## Snapshot management
2022-12-01 08:51:34 +01:00
_TODO_
## VM Limits
2023-02-19 16:01:08 +01:00
Check current limits
```sh
xe vm-param-get uuid={VM UUID} param-name={PARAMETER}
```
2022-12-01 08:51:34 +01:00
Parameters:
```
VCPUs-max: Maximum number of CPU cores
VCPUs-at-startup: Number of CPU cores initially assigned
```
2023-02-19 16:01:08 +01:00
Set Limits
```sh
xe vm-param-set uuid={VM UUID} {PARAMETER}={VALUE}
```
2022-12-01 08:52:45 +01:00
2023-02-19 16:01:08 +01:00
[TODO Memory limits](https://support.citrix.com/article/CTX219771/increase-ram-for-xenserver-vms-through-command-line-interface)