XCP: Difference between revisions
Jump to navigation
Jump to search
| Line 56: | Line 56: | ||
=VM Autostart= | =VM Autostart= | ||
*http://support.citrix.com/article/CTX133910 | *http://support.citrix.com/article/CTX133910 | ||
Gather the UUID’s of the pools you wish to auto-start. | |||
To get the list of the pool’s on your XenServer type “xe pool-list” | |||
Copy the UUID of the pool. If you have just one server, it will still have a pool UUID as noted in the following screenshot: | |||
Then type the following command to set the pool or server to allow auto-start: | |||
xe pool-param-set uuid=UUID other-config:auto_poweron=true | |||
Note: *Replacing UUID with the UUID of the XenServer or pool.* | |||
Setting the Virtual Machines to Auto-Start | |||
Gather the UUID’s of the Virtual Machine you want to auto-start by typing: | |||
xe vm-list | |||
Note: This generates a list of Virtual Machines in your pool or server and their associated UUID’s. | |||
Copy the UUID of the Virtual Machines you want to auto-start, and type the following command for each Virtual Machine to auto-start: | |||
xe vm-param-set uuid=UUID other-config:auto_poweron=true | |||
Note: *Replace UUID with the UUID of the Virtual Machine to auto-start.* | |||
Revision as of 13:22, 18 February 2014
SATA to VM Access
- add following lines to /etc/udev/rules.d/50-udev.rules and reboot (will not be persistent across reboots)
ACTION=="add", KERNEL=="sdb", SYMLINK+="xapi/block/%k", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'" ACTION=="remove", KERNEL=="sdb", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'"
XCP Backup Script
#!/usr/bin/env bash
#DST_PATH="${DST_PATH:-/tmp}"
DST_PATH="/media/drobo/XCPBACK"
backup() {
uuid="$1"
label_name=$( xe vm-list uuid="$uuid" | grep 'name-label' | cut -b 24- )
snapshot_uuid=$( xe vm-snapshot vm="$uuid" new-name-label=backup_vm )
xe template-param-set is-a-template=false ha-always-run=false uuid="$snapshot_uuid"
filename="$DST_PATH/$( date +%Y-%m-%d )-$uuid.xva"
echo "Filename:"
echo $filename
xe vm-export vm="$snapshot_uuid" filename="$filename"
xe vm-uninstall uuid="$snapshot_uuid" force=true
}
backup_all() {
options="vm-list is-control-domain=false is-a-template=false is-a-snapshot=false"
for uuid in $( xe $options | grep 'uuid' | awk -F': ' '{ print $2 }' ); do
backup "$uuid"
done
}
if [[ -z "$1" ]]; then
echo "Usage: $0 (<UUID>|all)"
echo "VMs Active:"
xe vm-list
exit 2
fi
if [[ "$1" = "all" ]]; then
backup_all
else
backup "$1"
fi
VM Autostart
Gather the UUID’s of the pools you wish to auto-start. To get the list of the pool’s on your XenServer type “xe pool-list” Copy the UUID of the pool. If you have just one server, it will still have a pool UUID as noted in the following screenshot:
Then type the following command to set the pool or server to allow auto-start: xe pool-param-set uuid=UUID other-config:auto_poweron=true Note: *Replacing UUID with the UUID of the XenServer or pool.*
Setting the Virtual Machines to Auto-Start
Gather the UUID’s of the Virtual Machine you want to auto-start by typing: xe vm-list Note: This generates a list of Virtual Machines in your pool or server and their associated UUID’s. Copy the UUID of the Virtual Machines you want to auto-start, and type the following command for each Virtual Machine to auto-start: xe vm-param-set uuid=UUID other-config:auto_poweron=true Note: *Replace UUID with the UUID of the Virtual Machine to auto-start.*