XenServer Error Recovery
XenServer Troubleshooting and Recovery Commands
When managing XenServer environments, you may occasionally encounter situations where VMs become unresponsive or the XenServer toolstack itself has issues. This guide provides essential commands for recovering from common error scenarios.
Toolstack Management
If the XenServer management interface becomes unresponsive or you’re experiencing issues with the toolstack:
1
2
# Restart the XenServer toolstack without rebooting the host
xe-toolstack-restart
This command restarts the management services without affecting running VMs or requiring a full server reboot.
Monitoring Tasks
To see what operations are currently running on your XenServer:
1
2
# List all current tasks
xe task-list
This helps identify any hung or long-running operations that might be causing issues.
VM Recovery Commands
Force Reboot a Hung VM
When a VM becomes unresponsive and normal shutdown/reboot commands don’t work:
1
2
3
4
5
# Force reboot a VM by name
xe vm-reboot vm="vm-name" --force
# Force reboot a VM by UUID
xe vm-reboot vm="uuid" --force
Note: This operation may take a long time to complete depending on the VM’s state.
Reset VM Power State
If a VM is stuck in an inconsistent power state (e.g., shows as running but is actually off):
1
2
3
4
5
# Reset power state by VM name
xe vm-reset-powerstate vm="vm-name" --force
# Reset power state by VM UUID
xe vm-reset-powerstate vm="uuid" --force
Additional Recovery Commands
Check VM Status
1
2
3
4
5
# Get detailed information about a VM
xe vm-list uuid="vm-uuid" params=all
# Check VM power state
xe vm-param-get uuid="vm-uuid" param-name=power-state
Storage Recovery
1
2
3
4
5
6
# Rescan storage repositories
xe sr-scan uuid="sr-uuid"
# Repair a broken storage repository
xe sr-forget uuid="sr-uuid"
xe sr-introduce uuid="sr-uuid" name-label="SR Name" type="type" content-type="content-type"
Host Recovery
1
2
3
4
5
6
7
8
# Enable maintenance mode
xe host-disable uuid="host-uuid"
# Disable maintenance mode
xe host-enable uuid="host-uuid"
# Emergency network reset
xe-reset-networking
Best Practices
- Always try normal shutdown procedures before using force commands
- Document VM UUIDs in case the name resolution fails during an outage
- Consider taking VM snapshots before attempting recovery operations
- Monitor XenServer logs for recurring issues:
/var/log/xensource.log