Citrix XenServer ® 7.0 Administrator's Guide 7 0 Administrators
User Manual: Pdf
Open the PDF directly: View PDF
.
Page Count: 232
Citrix XenServer ® 7.0 Administrator's Guide
Published October 2017
1.0 Edition
Citrix XenServer ® 7.0 Administrator's Guide
Copyright © 2016 Citrix Systems. Inc. All Rights Reserved.
Version: 7.0
Citrix, Inc.
851 West Cypress Creek Road
Fort Lauderdale, FL 33309
United States of America
Disclaimers
This document is furnished "AS IS." Citrix, Inc. disclaims all warranties regarding the contents of this document,
including, but not limited to, implied warranties of merchantability and fitness for any particular purpose. This
document may contain technical or other inaccuracies or typographical errors. Citrix, Inc. reserves the right to
revise the information in this document at any time without notice. This document and the software described
in this document constitute confidential information of Citrix, Inc. and its licensors, and are furnished under a
license from Citrix, Inc.
Citrix Systems, Inc., the Citrix logo, Citrix XenServer and Citrix XenCenter, are trademarks of Citrix Systems, Inc.
and/or one or more of its subsidiaries, and may be registered in the United States Patent and Trademark Office
and in other countries. All other trademarks and registered trademarks are property of their respective owners.
Trademarks
Citrix®
XenServer ®
XenCenter ®
Contents
1. Document Overview ...................................................................................... 1
1.1. Introducing XenServer .................................................................................................. 1
1.1.1. Benefits of Using XenServer ............................................................................... 1
1.1.2. Administering XenServer .................................................................................... 2
1.2. XenServer Documentation ............................................................................................ 2
2. Managing Users ............................................................................................. 3
2.1. Authenticating Users With Active Directory (AD) ............................................................ 3
2.1.1. Configuring Active Directory Authentication ........................................................ 4
2.1.2. User Authentication ........................................................................................... 6
2.1.3. Removing Access for a User ............................................................................... 7
2.1.4. Leaving an AD Domain ....................................................................................... 8
2.2. Role Based Access Control ............................................................................................ 8
2.2.1. Roles ................................................................................................................. 9
2.2.2. Definitions of RBAC Roles and Permissions ........................................................ 10
2.2.3. Using RBAC with the CLI .................................................................................. 16
2.2.3.1. To List All the Available Defined Roles in XenServer ................................. 16
2.2.3.2. To Display a List of Current Subjects: ...................................................... 16
2.2.3.3. To Add a Subject to RBAC ...................................................................... 17
2.2.3.4. To Assign an RBAC Role to a Created subject .......................................... 17
2.2.3.5. To Change a Subject's RBAC Role: .......................................................... 17
2.2.4. Auditing ........................................................................................................... 18
2.2.4.1. Audit Log xe CLI Commands .................................................................. 18
2.2.4.2. To Obtain All Audit Records From the Pool ............................................. 18
2.2.4.3. To Obtain Audit Records of the Pool Since a Precise Millisecond
Timestamp ........................................................................................................ 18
2.2.4.4. To Obtain Audit Records of the Pool Since a Precise Minute
Timestamp ........................................................................................................ 18
2.2.5. How Does XenServer Compute the Roles for the Session? .................................. 18
3. XenServer Hosts and Resource Pools .......................................................... 20
3.1. Hosts and Resource Pools Overview ............................................................................ 20
iii
3.2. Requirements for Creating Resource Pools ................................................................... 20
3.3. Creating a Resource Pool ............................................................................................ 21
3.4. Creating Heterogeneous Resource Pools ...................................................................... 22
3.5. Adding Shared Storage ................................................................................................ 22
3.6. Removing a XenServer Host from a Resource Pool ........................................................ 23
3.7. Preparing a Pool of XenServer Hosts for Maintenance .................................................. 23
3.8. Export Resource Pool Data .......................................................................................... 24
3.8.1. To Export Resource Data .................................................................................. 25
3.9. High Availability .......................................................................................................... 26
3.9.1. HA Overview ................................................................................................... 26
3.9.1.1. Overcommitting .................................................................................... 27
3.9.1.2. Overcommitment Warning .................................................................... 27
3.9.1.3. Host Fencing ......................................................................................... 27
3.9.2. Configuration Requirements ............................................................................. 27
3.9.3. Restart configuration settings ........................................................................... 28
3.9.3.1. Start order ............................................................................................ 29
3.10. Enabling HA on your XenServer Pool ......................................................................... 29
3.10.1. Enabling HA Using the CLI .............................................................................. 29
3.10.2. Removing HA Protection from a VM using the CLI ............................................ 30
3.10.3. Recovering an Unreachable Host .................................................................... 30
3.10.4. Shutting Down a host When HA is Enabled ..................................................... 30
3.10.5. Shutting Down a VM When it is Protected by HA ............................................. 31
3.11. Host Power On ......................................................................................................... 31
3.11.1. Powering on Hosts Remotely .......................................................................... 31
3.11.2. Using the CLI to Manage Host Power On ......................................................... 31
3.11.2.1. To Enable Host Power On Using the CLI ................................................ 31
3.11.2.2. To Turn on Hosts Remotely Using the CLI .............................................. 32
3.11.3. Configuring a Custom Script for XenServer's Host Power On Feature ................. 32
3.11.3.1. Key/Value Pairs ................................................................................... 32
3.11.3.1.1. host.power_on_mode ............................................................... 32
3.11.3.1.2. host.power_on_config .............................................................. 32
iv
3.11.3.2. Sample Script ...................................................................................... 33
3.12. Communicating with XenServer Hosts and Resource Pools .......................................... 33
4. Networking ................................................................................................... 34
4.1. Networking Support .................................................................................................... 34
4.2. vSwitch Networks ....................................................................................................... 34
4.3. XenServer Networking Overview ................................................................................. 35
4.3.1. Network Objects .............................................................................................. 36
4.3.2. Networks ......................................................................................................... 36
4.3.3. VLANs ............................................................................................................. 36
4.3.3.1. Using VLANs with Management Interfaces ............................................. 36
4.3.3.2. Using VLANs with Virtual Machines ........................................................ 36
4.3.3.3. Using VLANs with Dedicated Storage NICs .............................................. 36
4.3.3.4. Combining Management Interfaces and Guest VLANs on a Single Host
NIC ................................................................................................................... 37
4.3.4. Jumbo frames .................................................................................................. 37
4.3.5. NIC Bonds ....................................................................................................... 37
4.3.5.1. Active-Active Bonding ............................................................................ 39
4.3.5.2. Active-Passive Bonding .......................................................................... 40
4.3.5.3. LACP Link Aggregation Control Protocol Bonding ..................................... 41
4.3.5.4. Switch Configuration ............................................................................. 43
4.3.5.4.1. Switch Configuration for LACP Bonds ........................................... 44
4.3.6. Initial Networking Configuration after Setup ...................................................... 44
4.3.7. Changing Networking Configuration .................................................................. 45
4.3.7.1. Modifying the Network Object ............................................................... 45
4.3.8. Changing the Up Delay for Bonds ..................................................................... 45
4.4. Managing Networking Configuration ........................................................................... 46
4.4.1. Cross-Server Private Networks .......................................................................... 46
4.4.2. Creating Networks in a Standalone Server ......................................................... 47
4.4.3. Creating Networks in Resource Pools ................................................................ 47
4.4.4. Creating VLANs ................................................................................................ 47
4.4.5. Creating NIC Bonds on a Standalone Host ......................................................... 48
v
4.4.5.1. Creating a NIC Bond .............................................................................. 48
4.4.5.2. Controlling the MAC Address of the Bond .............................................. 48
4.4.5.3. Reverting NIC Bonds .............................................................................. 49
4.4.6. Creating NIC Bonds in Resource Pools ............................................................... 49
4.4.6.1. Adding NIC Bonds to New Resource Pools .............................................. 49
4.4.6.2. Adding NIC Bonds to an Existing Pool ..................................................... 50
4.4.7. Configuring a Dedicated Storage NIC ................................................................. 50
4.4.8. Using SR-IOV Enabled NICs ............................................................................... 51
4.4.9. Controlling the Rate of Outgoing Data (QoS) ..................................................... 52
4.4.10. Changing Networking Configuration Options ................................................... 53
4.4.10.1. Hostname ........................................................................................... 53
4.4.10.2. DNS Servers ........................................................................................ 53
4.4.10.3. Changing IP Address Configuration for a Standalone Host ...................... 53
4.4.10.4. Changing IP Address Configuration in Resource Pools ............................ 53
4.4.10.5. Management Interface ........................................................................ 54
4.4.10.6. Disabling Management Access ............................................................. 55
4.4.10.7. Adding a New Physical NIC .................................................................. 55
4.4.10.8. Using Switch Port Locking .................................................................... 55
4.4.10.8.1. Requirements ........................................................................... 55
4.4.10.8.2. Notes ....................................................................................... 55
4.4.10.8.3. Implementation Notes .............................................................. 56
4.4.10.8.4. Examples .................................................................................. 56
4.4.10.8.5. How Switch-port Locking Works ................................................ 57
4.4.10.8.6. VIF Locking-Mode States ........................................................... 57
4.4.10.8.7. Configuring Switch Port Locking ................................................ 58
4.4.10.8.8. Preventing a Virtual Machine from Sending or Receiving Traffic
from a Specific Network ............................................................................ 59
4.4.10.8.9. Removing a VIF's Restriction to an IP Address ............................. 60
4.4.10.8.10. Simplifying VIF Locking Mode Configuration in the Cloud ........... 60
4.4.10.8.11. Using Network Settings for VIF Traffic Filtering ......................... 61
4.5. Networking Troubleshooting ....................................................................................... 61
4.5.1. Diagnosing Network Corruption ........................................................................ 61
vi
4.5.2. Emergency Network Reset ............................................................................... 62
4.5.2.1. Verifying the Network Reset .................................................................. 62
4.5.2.2. Using the CLI for Network Reset ............................................................ 62
4.5.2.2.1. Pool Master Command Line Examples ......................................... 64
4.5.2.2.2. Pool Member Command Line Examples ....................................... 64
5. Storage ......................................................................................................... 66
5.1. Storage Overview ....................................................................................................... 66
5.1.1. Storage Repositories (SRs) ................................................................................ 66
5.1.2. Virtual Disk Image (VDI) ................................................................................... 66
5.1.3. Physical Block Devices (PBDs) ........................................................................... 66
5.1.4. Virtual Block Devices (VBDs) ............................................................................. 67
5.1.5. Summary of Storage objects ............................................................................. 67
5.1.6. Virtual Disk Data Formats ................................................................................. 67
5.1.6.1. VDI Types ............................................................................................. 67
5.1.6.2. Creating a Raw Virtual Disk Using the xe CLI ........................................... 67
5.1.6.3. Converting Between VDI Formats ........................................................... 68
5.1.6.4. VHD-based VDIs .................................................................................... 68
5.2. Storage Repository Formats ........................................................................................ 69
5.2.1. Local LVM ........................................................................................................ 69
5.2.1.1. LVM Performance Considerations ........................................................... 69
5.2.1.2. Creating a Local LVM SR (lvm) ................................................................ 70
5.2.2. Local EXT3 ....................................................................................................... 70
5.2.2.1. Creating a Local EXT3 SR (ext) ................................................................ 70
5.2.3. udev ................................................................................................................ 70
5.2.4. ISO .................................................................................................................. 71
5.2.5. Software iSCSI Support ..................................................................................... 71
5.2.5.1. XenServer Host iSCSI configuration ......................................................... 71
5.2.6. Software FCoE Storage ..................................................................................... 72
5.2.6.1. Creating a Software FCoE SR .................................................................. 72
5.2.7. Hardware Host Bus Adapters (HBAs) ................................................................. 72
5.2.7.1. Sample QLogic iSCSI HBA setup ............................................................. 72
vii
5.2.7.2. Removing HBA-based SAS, FC or iSCSI Device Entries .............................. 73
5.2.8. Shared LVM Storage ......................................................................................... 73
5.2.8.1. Creating a Shared LVM Over iSCSI SR Using the Software iSCSI Initiator
(lvmoiscsi) ......................................................................................................... 73
5.2.8.2. Creating a Shared LVM over Fibre Channel / Fibre Channel over
Ethernet / iSCSI HBA or SAS SR (lvmohba) .......................................................... 74
5.2.9. NFS and SMB ................................................................................................... 76
5.2.9.1. Creating a Shared NFS SR (NFS) ............................................................. 76
5.2.9.2. Creating a Shared SMB SR (SMB) ........................................................... 77
5.2.10. LVM over Hardware HBA ................................................................................ 78
5.3. Storage Configuration ................................................................................................. 78
5.3.1. Creating Storage Repositories ........................................................................... 78
5.3.2. Probing an SR .................................................................................................. 79
5.4. Storage Multipathing .................................................................................................. 81
5.5. XenServer and IntelliCache .......................................................................................... 82
5.5.1. IntelliCache Deployment .................................................................................. 82
5.5.1.1. Enabling on Host Installation ................................................................. 83
5.5.1.2. Converting an Existing Host to Use Thin Provisioning ............................... 83
5.5.1.3. VM Boot Behavior ................................................................................. 84
5.5.1.3.1. VM Caching Behavior Settings ..................................................... 84
5.5.1.4. Implementation Details and Troubleshooting .......................................... 84
5.6. Storage Read Caching ................................................................................................. 85
5.6.1. Enabling and Disabling ..................................................................................... 85
5.6.2. Limitations ....................................................................................................... 86
5.6.3. Comparison with IntelliCache ........................................................................... 86
5.6.4. To Set the Read Cache Size .............................................................................. 86
5.6.4.1. How to View the Current dom0 Memory Allocation ................................ 86
5.6.4.2. XenCenter Display Notes ....................................................................... 87
5.7. Managing Storage Repositories ................................................................................... 87
5.7.1. Removing SRs .................................................................................................. 87
5.7.2. Introducing an SR ............................................................................................ 88
5.7.3. Live LUN Expansion .......................................................................................... 88
viii
5.7.4. Live VDI Migration ........................................................................................... 89
5.7.4.1. Limitations and Caveats ......................................................................... 89
5.7.4.2. To Move Virtual Disks using XenCenter ................................................... 89
5.7.5. Cold VDI Migration between SRs (Offline Migration) .......................................... 89
5.7.5.1. Copying All of a VMs VDIs to a Different SR ............................................ 89
5.7.5.2. Copying Individual VDIs to a Different SR ................................................ 89
5.7.6. Converting Local Fibre Channel SRs to Shared SRs ............................................. 90
5.7.7. Reclaiming Space for Block-Based Storage on the Backing Array Using Discard ..... 90
5.7.8. Automatically Reclaiming Space When Deleting Snapshots ................................. 91
5.7.8.1. Reclaiming Space Using the Off Line Coalesce Tool .................................. 91
5.7.9. Adjusting the Disk IO Scheduler ........................................................................ 92
5.7.10. Virtual Disk QoS Settings ................................................................................ 92
6. Configuring VM Memory ............................................................................. 94
6.1. What is Dynamic Memory Control (DMC)? .................................................................. 94
6.1.1. The Concept of Dynamic Range ........................................................................ 94
6.1.2. The Concept of Static Range ............................................................................. 94
6.1.3. DMC Behavior ................................................................................................. 95
6.1.4. How Does DMC Work? ..................................................................................... 95
6.1.5. Memory Constraints ........................................................................................ 95
6.2. xe CLI Commands ....................................................................................................... 96
6.2.1. Display the Static Memory Properties of a VM .................................................. 96
6.2.2. Display the Dynamic Memory Properties of a VM .............................................. 96
6.2.3. Updating Memory Properties ........................................................................... 97
6.2.4. Update Individual Memory Properties .............................................................. 97
6.3. Upgrade Issues ........................................................................................................... 98
7. XenServer Memory Usage ........................................................................... 99
7.1. Control Domain Memory ............................................................................................ 99
7.1.1. Changing the Amount of Memory Allocated to the Control Domain .................... 99
7.1.2. How Much Memory is Available to VMs .......................................................... 100
8. Disaster Recovery and Backup ................................................................... 101
ix
8.1. Understanding XenServer DR ..................................................................................... 101
8.2. DR Infrastructure Requirements ................................................................................ 101
8.3. Deployment Considerations ....................................................................................... 103
8.3.1. Steps to Take Before a Disaster ....................................................................... 103
8.3.2. Steps to Take After a Disaster ......................................................................... 103
8.3.3. Steps to Take After a Recovery ....................................................................... 103
8.4. Enabling Disaster Recovery in XenCenter ................................................................... 103
8.5. Recovering VMs and vApps in the Event of Disaster (Failover) ..................................... 104
8.6. Restoring VMs and vApps to the Primary Site After Disaster (Failback) ......................... 105
8.7. Test Failover ............................................................................................................. 105
8.8. vApps ....................................................................................................................... 107
8.8.1. Using the Manage vApps dialog box in XenCenter ............................................ 107
8.9. Backing Up and Restoring XenServer Hosts and VMs .................................................. 107
8.9.1. Backing up Virtual Machine metadata ............................................................. 109
8.9.1.1. Backing up single host installations ...................................................... 109
8.9.1.2. Backing up pooled installations ............................................................ 109
8.9.2. Backing up XenServer hosts ............................................................................ 110
8.9.3. Backing up VMs ............................................................................................. 111
8.10. VM Snapshots ......................................................................................................... 111
8.10.1. Regular Snapshots ........................................................................................ 111
8.10.2. Quiesced Snapshots ..................................................................................... 111
8.10.3. Snapshots with memory ............................................................................... 112
8.10.4. Creating a VM Snapshot ............................................................................... 112
8.10.5. Creating a snapshot with memory ................................................................ 112
8.10.6. To list all of the snapshots on a XenServer pool ............................................. 113
8.10.7. To list the snapshots on a particular VM ........................................................ 113
8.10.8. Restoring a VM to its previous state .............................................................. 114
8.10.8.1. Deleting a snapshot ........................................................................... 114
8.10.9. Snapshot Templates ..................................................................................... 115
8.10.9.1. Creating a template from a snapshot .................................................. 115
8.10.9.2. Exporting a snapshot to a template .................................................... 115
x
8.10.9.3. Advanced Notes for Quiesced Snapshots ............................................ 116
8.11. Coping with machine failures .................................................................................. 116
8.11.1. Member failures .......................................................................................... 116
8.11.2. Master failures ............................................................................................. 117
8.11.3. Pool failures ................................................................................................. 118
8.11.4. Coping with Failure due to Configuration Errors ............................................. 118
8.11.5. Physical Machine failure ............................................................................... 118
9. Monitoring and Managing XenServer ........................................................ 120
9.1. Monitoring XenServer Performance ........................................................................... 120
9.1.1. Available Host Metrics .................................................................................... 120
9.1.2. Available VM Metrics ..................................................................................... 123
9.1.3. Analyzing and Visualizing Metrics in XenCenter ............................................... 125
9.1.3.1. Configuring Performance Graphs .......................................................... 125
9.1.3.1.1. Configuring the Graph Type ...................................................... 126
9.1.4. Configuring Metrics ........................................................................................ 126
9.1.5. Using RRDs .................................................................................................... 127
9.1.5.1. Analysing RRDs using HTTP .................................................................. 128
9.1.5.2. Analysing RRDs using rrd2csv ............................................................... 128
9.2. Alerts ....................................................................................................................... 128
9.2.1. Using XenCenter to View Alerts ...................................................................... 128
9.2.1.1. XenCenter Performance Alerts ............................................................. 128
9.2.1.1.1. To Configure Performance Alerts ............................................... 129
9.2.1.2. XenCenter Alerts ................................................................................. 130
9.2.1.3. XenCenter Software Update Alerts ....................................................... 131
9.2.2. Configuring Performance Alerts Using the xe CLI .............................................. 131
9.2.2.1. Generic Example Configuration ............................................................ 133
9.3. Configuring Email Alerts ............................................................................................ 133
9.3.1. Enabling Email Alerts Using XenCenter ............................................................ 134
9.3.2. Enabling Email Alerts using the xe CLI ............................................................. 134
9.3.2.1. Sending Email Alerts Through Authenticated SMTP Servers .................... 134
9.3.2.1.1. Additional Configuration Options ............................................... 134
xi
9.4. Custom Fields and Tags ............................................................................................. 135
9.5. Custom Searches ...................................................................................................... 135
9.6. Determining throughput of physical bus adapters ....................................................... 136
10. Troubleshooting ....................................................................................... 137
10.1. Support .................................................................................................................. 137
10.2. Health Check .......................................................................................................... 137
10.3. XenServer host logs ................................................................................................ 138
10.3.1. Sending host log messages to a central server ............................................... 138
10.4. XenCenter logs ........................................................................................................ 138
10.5. Troubleshooting connections between XenCenter and the XenServer host ................. 138
A. Command Line Interface ........................................................................... 140
A.1. Basic xe Syntax ......................................................................................................... 140
A.2. Special Characters and Syntax ................................................................................... 141
A.3. Command Types ....................................................................................................... 141
A.3.1. Parameter Types ............................................................................................ 142
A.3.2. Low-level Parameter Commands .................................................................... 143
A.3.3. Low-level List Commands ............................................................................... 143
A.4. xe Command Reference ............................................................................................ 144
A.4.1. Appliance Commands .................................................................................... 144
A.4.1.1. Appliance Parameters .......................................................................... 144
A.4.1.2. appliance-assert-can-be-recovered ....................................................... 144
A.4.1.3. appliance-create ................................................................................. 144
A.4.1.4. appliance-destroy ................................................................................ 145
A.4.1.5. appliance-recover ................................................................................ 145
A.4.1.6. appliance-shutdown ............................................................................ 145
A.4.1.7. appliance-start .................................................................................... 145
A.4.2. Audit Commands ........................................................................................... 145
A.4.2.1. audit-log-get parameters ..................................................................... 145
A.4.2.2. audit-log-get ....................................................................................... 145
A.4.3. Bonding Commands ....................................................................................... 146
A.4.3.1. Bond Parameters ................................................................................ 146
xii
A.4.3.2. bond-create ........................................................................................ 146
A.4.3.3. bond-destroy ...................................................................................... 146
A.4.4. CD Commands ............................................................................................... 146
A.4.4.1. CD Parameters .................................................................................... 146
A.4.4.2. cd-list ................................................................................................. 147
A.4.5. Console Commands ....................................................................................... 148
A.4.5.1. Console Parameters ............................................................................ 148
A.4.6. Disaster Recovery (DR) Commands ................................................................. 148
A.4.6.1. drtask-create ...................................................................................... 148
A.4.6.2. drtask-destroy ..................................................................................... 149
A.4.6.3. vm-assert-can-be-recovered ................................................................ 149
A.4.6.4. appliance-assert-can-be-recovered ....................................................... 149
A.4.6.5. appliance-recover ................................................................................ 149
A.4.6.6. vm-recover ......................................................................................... 149
A.4.6.7. sr-enable-database-replication ............................................................. 149
A.4.6.8. sr-disable-database-replication ............................................................ 149
A.4.6.9. Example Usage ................................................................................... 149
A.4.7. Event Commands ........................................................................................... 150
A.4.7.1. Event Classes ...................................................................................... 150
A.4.7.2. event-wait .......................................................................................... 150
A.4.8. GPU Commands ............................................................................................ 151
A.4.8.1. Physical GPU (pGPU) Parameters ......................................................... 151
A.4.8.2. pGPU Operations ................................................................................ 152
A.4.8.2.1. pgpu-param-set ........................................................................ 152
A.4.8.2.2. pgpu-param-get-uuid ................................................................ 152
A.4.8.2.3. pgpu-param-set-uuid ................................................................ 152
A.4.8.2.4. pgpu-param-add-uuid ............................................................... 152
A.4.8.3. GPU Group Parameters ....................................................................... 152
A.4.8.3.1. GPU Group Operations ............................................................. 153
A.4.8.4. Virtual GPU Parameters ....................................................................... 153
A.4.8.5. Virtual GPU Type Parameters ............................................................... 154
xiii
A.4.8.6. Virtual GPU Operations ....................................................................... 155
A.4.8.6.1. vgpu-create .............................................................................. 155
A.4.8.6.2. vgpu-destroy ............................................................................ 155
A.4.8.6.3. Disabling VNC for VMs with virtual GPU .................................... 155
A.4.9. Host Commands ............................................................................................ 155
A.4.9.1. Host Selectors ..................................................................................... 155
A.4.9.2. Host Parameters ................................................................................. 156
A.4.9.3. host-backup ........................................................................................ 159
A.4.9.4. host-bugreport-upload ........................................................................ 159
A.4.9.5. host-crashdump-destroy ...................................................................... 159
A.4.9.6. host-crashdump-upload ....................................................................... 159
A.4.9.7. host-disable ........................................................................................ 159
A.4.9.8. host-dmesg ......................................................................................... 159
A.4.9.9. host-emergency-management-reconfigure ........................................... 160
A.4.9.10. host-enable ....................................................................................... 160
A.4.9.11. host-evacuate ................................................................................... 160
A.4.9.12. host-forget ........................................................................................ 160
A.4.9.13. host-get-system-status ....................................................................... 160
A.4.9.14. host-get-system-status-capabilities ..................................................... 161
A.4.9.15. host-is-in-emergency-mode ............................................................... 162
A.4.9.16. host-apply-edition ............................................................................. 162
A.4.9.17. host-license-add ................................................................................ 162
A.4.9.18. host-license-view .............................................................................. 162
A.4.9.19. host-logs-download ........................................................................... 162
A.4.9.20. host-management-disable ................................................................. 162
A.4.9.21. host-management-reconfigure ........................................................... 163
A.4.9.22. host-power-on .................................................................................. 163
A.4.9.23. host-get-cpu-features ........................................................................ 163
A.4.9.24. host-set-cpu-features ........................................................................ 163
A.4.9.25. host-set-power-on ............................................................................. 163
A.4.9.26. host-reboot ....................................................................................... 164
xiv
A.4.9.27. host-restore ...................................................................................... 164
A.4.9.28. host-set-hostname-live ...................................................................... 164
A.4.9.29. host-shutdown .................................................................................. 164
A.4.9.30. host-syslog-reconfigure ...................................................................... 165
A.4.9.31. host-data-source-list .......................................................................... 165
A.4.9.32. host-data-source-record .................................................................... 165
A.4.9.33. host-data-source-forget ..................................................................... 165
A.4.9.34. host-data-source-query ..................................................................... 166
A.4.10. Message Commands .................................................................................... 166
A.4.10.1. Message Parameters ......................................................................... 166
A.4.10.2. message-create ................................................................................. 166
A.4.10.3. message-destroy ............................................................................... 166
A.4.10.4. message-list ...................................................................................... 166
A.4.11. Network Commands .................................................................................... 167
A.4.11.1. Network Parameters .......................................................................... 167
A.4.11.2. network-create ................................................................................. 168
A.4.11.3. network-destroy ................................................................................ 168
A.4.12. Patch (Update) Commands ........................................................................... 168
A.4.12.1. Patch Parameters .............................................................................. 168
A.4.12.2. patch-apply ....................................................................................... 169
A.4.12.3. patch-pool-clean ............................................................................... 169
A.4.12.4. patch-pool-apply ............................................................................... 169
A.4.12.5. patch-precheck ................................................................................. 169
A.4.12.6. patch-upload ..................................................................................... 169
A.4.13. PBD Commands ........................................................................................... 169
A.4.13.1. PBD Parameters ................................................................................ 169
A.4.13.2. pbd-create ........................................................................................ 170
A.4.13.3. pbd-destroy ...................................................................................... 170
A.4.13.4. pbd-plug ........................................................................................... 170
A.4.13.5. pbd-unplug ....................................................................................... 170
A.4.14. PIF Commands ............................................................................................. 170
xv
A.4.14.1. PIF Parameters .................................................................................. 171
A.4.14.2. pif-forget .......................................................................................... 173
A.4.14.3. pif-introduce ..................................................................................... 173
A.4.14.4. pif-plug ............................................................................................. 173
A.4.14.5. pif-reconfigure-ip .............................................................................. 173
A.4.14.6. pif-scan ............................................................................................. 174
A.4.14.7. pif-unplug ......................................................................................... 174
A.4.15. Pool Commands ........................................................................................... 174
A.4.15.1. Pool Parameters ................................................................................ 174
A.4.15.2. pool-designate-new-master ............................................................... 175
A.4.15.3. pool-dump-database ......................................................................... 175
A.4.15.4. pool-eject ......................................................................................... 176
A.4.15.5. pool-emergency-reset-master ............................................................ 176
A.4.15.6. pool-emergency-transition-to-master ................................................. 176
A.4.15.7. pool-ha-enable .................................................................................. 176
A.4.15.8. pool-ha-disable ................................................................................. 176
A.4.15.9. pool-join ........................................................................................... 176
A.4.15.10. pool-recover-slaves .......................................................................... 176
A.4.15.11. pool-restore-database ...................................................................... 176
A.4.15.12. pool-sync-database .......................................................................... 177
A.4.16. Storage Manager Commands ........................................................................ 177
A.4.16.1. SM Parameters ................................................................................. 177
A.4.17. SR Commands .............................................................................................. 177
A.4.17.1. SR Parameters ................................................................................... 178
A.4.17.2. sr-create ........................................................................................... 179
A.4.17.3. sr-destroy ......................................................................................... 179
A.4.17.4. sr-enable-database-replication ........................................................... 179
A.4.17.5. sr-disable-database-replication .......................................................... 179
A.4.17.6. sr-forget ............................................................................................ 179
A.4.17.7. sr-introduce ...................................................................................... 179
A.4.17.8. sr-probe ............................................................................................ 180
xvi
A.4.17.9. sr-scan .............................................................................................. 180
A.4.18. Task Commands ........................................................................................... 180
A.4.18.1. Task Parameters ................................................................................ 180
A.4.18.2. task-cancel ........................................................................................ 181
A.4.19. Template Commands .................................................................................... 181
A.4.19.1. VM Template Parameters .................................................................. 182
A.4.19.2. template-export ................................................................................ 188
A.4.20. Update Commands ...................................................................................... 188
A.4.20.1. update-upload .................................................................................. 188
A.4.21. User Commands .......................................................................................... 188
A.4.21.1. user-password-change ....................................................................... 188
A.4.22. VBD Commands ........................................................................................... 188
A.4.22.1. VBD Parameters ................................................................................ 188
A.4.22.2. vbd-create ........................................................................................ 190
A.4.22.3. vbd-destroy ....................................................................................... 190
A.4.22.4. vbd-eject .......................................................................................... 190
A.4.22.5. vbd-insert ......................................................................................... 190
A.4.22.6. vbd-plug ........................................................................................... 191
A.4.22.7. vbd-unplug ....................................................................................... 191
A.4.23. VDI Commands ............................................................................................ 191
A.4.23.1. VDI Parameters ................................................................................. 191
A.4.23.2. vdi-clone ........................................................................................... 192
A.4.23.3. vdi-copy ............................................................................................ 193
A.4.23.4. vdi-create ......................................................................................... 193
A.4.23.5. vdi-destroy ........................................................................................ 193
A.4.23.6. vdi-forget .......................................................................................... 193
A.4.23.7. vdi-import ......................................................................................... 193
A.4.23.8. vdi-introduce .................................................................................... 194
A.4.23.9. vdi-pool-migrate ................................................................................ 194
A.4.23.10. vdi-resize ........................................................................................ 194
A.4.23.11. vdi-snapshot ................................................................................... 194
xvii
A.4.23.12. vdi-unlock ....................................................................................... 194
A.4.24. VIF Commands ............................................................................................. 195
A.4.24.1. VIF Parameters .................................................................................. 195
A.4.24.2. vif-create .......................................................................................... 196
A.4.24.3. vif-destroy ........................................................................................ 197
A.4.24.4. vif-plug ............................................................................................. 197
A.4.24.5. vif-unplug ......................................................................................... 197
A.4.24.6. vif-configure-ipv4 .............................................................................. 197
A.4.24.7. vif-configure-ipv6 .............................................................................. 197
A.4.25. VLAN Commands ......................................................................................... 197
A.4.25.1. vlan-create ........................................................................................ 197
A.4.25.2. pool-vlan-create ................................................................................ 197
A.4.25.3. vlan-destroy ...................................................................................... 198
A.4.26. VM Commands ............................................................................................ 198
A.4.26.1. VM Selectors ..................................................................................... 198
A.4.26.2. VM Parameters ................................................................................. 198
A.4.26.3. vm-assert-can-be-recovered ............................................................... 204
A.4.26.4. vm-cd-add ........................................................................................ 205
A.4.26.5. vm-cd-eject ....................................................................................... 205
A.4.26.6. vm-cd-insert ...................................................................................... 205
A.4.26.7. vm-cd-list .......................................................................................... 205
A.4.26.8. vm-cd-remove ................................................................................... 205
A.4.26.9. vm-clone ........................................................................................... 206
A.4.26.10. vm-compute-maximum-memory ...................................................... 206
A.4.26.11. vm-copy .......................................................................................... 206
A.4.26.12. vm-crashdump-list ........................................................................... 206
A.4.26.13. vm-data-source-list .......................................................................... 207
A.4.26.14. vm-data-source-record .................................................................... 207
A.4.26.15. vm-data-source-forget ..................................................................... 207
A.4.26.16. vm-data-source-query ..................................................................... 207
A.4.26.17. vm-destroy ...................................................................................... 208
xviii
A.4.26.18. vm-disk-add .................................................................................... 208
A.4.26.19. vm-disk-list ..................................................................................... 208
A.4.26.20. vm-disk-remove .............................................................................. 208
A.4.26.21. vm-export ....................................................................................... 208
A.4.26.22. vm-import ....................................................................................... 209
A.4.26.23. vm-install ........................................................................................ 209
A.4.26.24. vm-memory-shadow-multiplier-set .................................................. 209
A.4.26.25. vm-migrate ..................................................................................... 210
A.4.26.26. vm-reboot ....................................................................................... 211
A.4.26.27. vm-recover ...................................................................................... 211
A.4.26.28. vm-reset-powerstate ....................................................................... 211
A.4.26.29. vm-resume ...................................................................................... 211
A.4.26.30. vm-shutdown .................................................................................. 211
A.4.26.31. vm-start .......................................................................................... 212
A.4.26.32. vm-suspend .................................................................................... 212
A.4.26.33. vm-uninstall .................................................................................... 212
A.4.26.34. vm-vcpu-hotplug ............................................................................. 212
A.4.26.35. vm-vif-list ........................................................................................ 212
xix
Chapter 1. Document Overview
This document is a system administrator's guide for XenServer, the complete server virtualization platform from
Citrix. It contains procedures to guide you through configuring a XenServer deployment. In particular, it focuses on
setting up storage, networking and resource pools, and how to administer XenServer hosts using the xe command
line interface.
This document covers the following topics:
•
Managing Users with Active Directory and Role Based Access Control
•
Creating Resource Pools and setting up High Availability
•
Configuring and Managing Storage Repositories
•
Configuring Virtual Machine Memory using Dynamic Memory Control
•
Setting Control Domain Memory on a XenServer host
•
Configuring Networking
•
Recovering Virtual Machines using Disaster Recovery and Backing Up Data
•
Monitoring XenServer Performance Metrics and Configuring Alerts
•
Troubleshooting XenServer
•
Using the XenServer xe command line interface
1.1. Introducing XenServer
XenServer is the complete server virtualization platform from Citrix. The XenServer package contains all you need
to create and manage a deployment of virtual x86 computers running on Xen, the open-source paravirtualizing
hypervisor with near-native performance. XenServer is optimized for both Windows and Linux virtual servers.
XenServer runs directly on server hardware without requiring an underlying operating system, which results in
an efficient and scalable system. XenServer works by abstracting elements from the physical machine (such as
hard drives, resources and ports) and allocating them to the virtual machines running on it.
A virtual machine (VM) is a computer composed entirely of software that can run its own operating system and
applications as if it were a physical computer. A VM behaves exactly like a physical computer and contains its own
virtual (software-based) CPU, RAM, hard disk and network interface card (NIC).
XenServer lets you create VMs, take VM disk snapshots and manage VM workloads. For a comprehensive list of
major XenServer features, visit www.citrix.com/xenserver.
1.1.1. Benefits of Using XenServer
Using XenServer reduces costs by:
•
Consolidating multiple VMs onto physical servers
•
Reducing the number of separate disk images that need to be managed
•
Allowing for easy integration with existing networking and storage infrastructures
Using XenServer increases flexibility by:
•
Allowing you to schedule zero downtime maintenance by using XenMotion to live migrate VMs between
XenServer hosts
•
Increasing availability of VMs by using High Availability to configure policies that restart VMs on another
XenServer host if one fails
•
Increasing portability of VM images, as one VM image will work on a range of deployment infrastructures
1
1.1.2. Administering XenServer
There are two methods by which to administer XenServer: XenCenter and the XenServer Command-Line Interface
(CLI).
XenCenter is a graphical, Windows-based user interface. XenCenter allows you to manage XenServer hosts, pools
and shared storage, and to deploy, manage and monitor VMs from your Windows desktop machine.
The XenCenter on-line Help is a useful resource for getting started with XenCenter and for context-sensitive
assistance.
The XenServer Command-line Interface (CLI) allows you to administer XenServer using the Linux-based xe
commands.
1.2. XenServer Documentation
XenServer documentation shipped with this release includes:
•
XenServer Release Notes cover new features in XenServer 7.0 and any advisories and known issues that affect
this release.
•
XenServer Quick Start Guide provides an introduction for new users to the XenServer environment and
components. This guide steps through the installation and configuration essentials to get XenServer and the
XenCenter management console up and running quickly. After installation, it demonstrates how to create
a Windows VM, VM template and pool of XenServer hosts. It introduces basic administrative tasks and
advanced features, such as shared storage, VM snapshots and XenMotion live migration.
•
XenServer Installation Guide steps through the installation, configuration and initial operation of XenServer
and the XenCenter management console.
•
XenServer Virtual Machine User's Guide describes how to install Windows and Linux VMs within a XenServer
environment. This guide explains how to create new VMs from installation media, from VM templates
included in the XenServer package and from existing physical machines (P2V). It explains how to import disk
images and how to import and export appliances.
•
XenServer Administrator's Guide gives an in-depth description of the tasks involved in configuring a XenServer
deployment, including setting up storage, networking and pools. It describes how to administer XenServer
using the xe Command Line Interface.
•
vSwitch Controller User's Guide is a comprehensive user guide to the vSwitch Controller for XenServer.
•
Supplemental Packs and the DDK introduces the XenServer Driver Development Kit, which can be used to
modify and extend the functionality of XenServer.
•
XenServer Software Development Kit Guide presents an overview of the XenServer SDK. It includes code
samples that demonstrate how to write applications that interface with XenServer hosts.
•
XenAPI Specification is a reference guide for programmers to the XenServer API.
For additional resources, visit the Citrix Knowledge Center.
2
Chapter 2. Managing Users
Defining users, groups, roles and permissions allows you to control who has access to your XenServer hosts and
pools and what actions they can perform.
When you first install XenServer, a user account is added to XenServer automatically. This account is the local
super user (LSU), or root, which is authenticated locally by the XenServer computer.
The LSU, or root, is a special user account intended for system administration and has all rights or permissions.
In XenServer, the LSU is the default account at installation. The LSU is only authenticated by XenServer and does
not require any external authentication service. If an external authentication service fails, the LSU can still log in
and manage the system. The LSU can always access the XenServer physical server through SSH.
You can create additional users by adding the Active Directory accounts through either XenCenter's Users tab or
the xe CLI. If your environment does not use Active Directory, you are limited to the LSU account.
Note:
When you create new users, XenServer does not assign newly created user accounts RBAC
roles automatically. As a result, these accounts do not have any access to the XenServer pool
until you assign them a role.
These permissions are granted through roles, as discussed in Section 2.1, “Authenticating Users With Active
Directory (AD)”.
2.1. Authenticating Users With Active Directory (AD)
If you want to have multiple user accounts on a server or a pool, you must use Active Directory user accounts for
authentication. This lets XenServer users log in to a pool using their Windows domain credentials.
The only way you can configure varying levels of access for specific users is by enabling Active Directory
authentication, adding user accounts, and assign roles to those accounts.
Active Directory users can use the xe CLI (passing appropriate -u and -pw arguments) and also connect to the
host using XenCenter. Authentication is done on a per-resource pool basis.
Access is controlled by the use of subjects. A subject in XenServer maps to an entity on your directory server
(either a user or a group). When external authentication is enabled, the credentials used to create a session are
first checked against the local root credentials (in case your directory server is unavailable) and then against the
subject list. To permit access, you must create a subject entry for the person or group you wish to grant access
to. This can be done using XenCenter or the xe CLI.
If you are familiar with XenCenter, note that the XenServer CLI uses slightly different terminology to refer to Active
Directory and user account features:
3
XenCenter Term
XenServer CLI Term
Users
Subjects
Add users
Add subjects
Understanding Active Directory Authentication in the XenServer Environment
Even though XenServer is Linux-based, XenServer lets you use Active Directory accounts for XenServer user
accounts. To do so, it passes Active Directory credentials to the Active Directory domain controller.
When added to XenServer, Active Directory users and groups become XenServer subjects, generally referred to
as simply users in XenCenter. When a subject is registered with XenServer, users/groups are authenticated with
Active Directory on login and do not need to qualify their user name with a domain name.
Note:
By default, if you did not qualify the user name (for example, enter either mydomain\myuser
or myser@mydomain.com), XenCenter always attempts to log users in to Active Directory
authentication servers using the domain to which it is currently joined. The exception to this
is the LSU account, which XenCenter always authenticates locally (that is, on the XenServer)
first.
The external authentication process works as follows:
1. The credentials supplied when connecting to a server are passed to the Active Directory domain controller
for authentication.
2. The domain controller checks the credentials. If they are invalid, the authentication fails immediately.
3. If the credentials are valid, the Active Directory controller is queried to get the subject identifier and group
membership associated with the credentials.
4. If the subject identifier matches the one stored in the XenServer, the authentication is completed successfully.
When you join a domain, you enable Active Directory authentication for the pool. However, when a pool is joined
to a domain, only users in that domain (or a domain with which it has trust relationships) can connect to the pool.
Note:
Manually updating the DNS configuration of a DHCP-configured network PIF is unsupported
and might cause Active Directory integration, and consequently user authentication, to fail
or stop working.
2.1.1. Configuring Active Directory Authentication
XenServer supports use of Active Directory servers using Windows 2003 or later.
Active Directory authentication for a XenServer host requires that the same DNS servers are used for both the
Active Directory server (configured to allow for interoperability) and the XenServer host. In some configurations,
the active directory server may provide the DNS itself. This can be achieved either using DHCP to provide the
IP address and a list of DNS servers to the XenServer host, or by setting values in the PIF objects or using the
installer if a manual static configuration is used.
Citrix recommends enabling DHCP to broadcast host names. In particular, the host names localhost or linux
should not be assigned to hosts.
Warning:
XenServer hostnames should be unique throughout the XenServer deployment.
4
Note the following:
•
XenServer labels its AD entry on the AD database using its hostname. Therefore, if two XenServer hosts have
the same hostname and are joined to the same AD domain, the second XenServer will overwrite the AD entry
of the first XenServer, regardless of if they are in the same or in different pools, causing the AD authentication
on the first XenServer to stop working.
It is possible to use the same hostname in two XenServer hosts, as long as they join different AD domains.
•
The XenServer hosts can be in different time-zones, as it is the UTC time that is compared. To ensure
synchronization is correct, you may choose to use the same NTP servers for your XenServer pool and the
Active Directory server.
•
Mixed-authentication pools are not supported (that is, you cannot have a pool where some servers in the
pool are configured to use Active Directory and some are not).
•
The XenServer Active Directory integration uses the Kerberos protocol to communicate with the Active
Directory servers. Consequently, XenServer does not support communicating with Active Directory servers
that do not utilize Kerberos.
•
For external authentication using Active Directory to be successful, it is important that the clocks on your
XenServer hosts are synchronized with those on your Active Directory server. When XenServer joins the Active
Directory domain, this will be checked and authentication will fail if there is too much skew between the
servers.
Warning:
Host names must consist solely of no more than 63 alphanumeric characters, and must not
be purely numeric.
Once you have Active Directory authentication enabled, if you subsequently add a server to that pool, you are
prompted to configure Active Directory on the server joining the pool. When you are prompted for credentials
on the joining server, enter Active Directory credentials with sufficient privileges to add servers to that domain.
Active Directory integration
Make sure that the following firewall ports are open for outbound traffic in order for XenServer to access the
domain controllers.
Port
Protocol
Use
53
UDP/TCP
DNS
88
UDP/TCP
Kerberos 5
123
UDP
NTP
137
UDP
NetBIOS Name Service
139
TCP
NetBIOS Session (SMB)
389
UDP/TCP
LDAP
445
TCP
SMB over TCP
464
UDP/TCP
Machine password changes
3268
TCP
Global Catalog Search
Note:
To view the firewall rules on a Linux computer using iptables, run the following command:
iptables - nL.
5
Note:
XenServer uses PowerBroker Identity Services (PBIS) to authenticate the AD user in the AD
server, and to encrypt communications with the AD server.
How does XenServer manage the machine account password for AD integration?
Similarly to Windows client machines, PBIS automatically updates the machine account password, renewing it
once every 30 days, or as specified in the machine account password renewal policy in the AD server.
Enabling external authentication on a pool
•
External authentication using Active Directory can be configured using either XenCenter or the CLI using the
command below.
xe pool-enable-external-auth auth-type=AD \
service-name= \
config:user= \
config:pass=
The user specified needs to have Add/remove computer objects or workstations privileges,
which is the default for domain administrators.
Note:
If you are not using DHCP on the network used by Active Directory and your XenServer hosts,
use you can use these two approaches to setup your DNS:
1. Set up your domain DNS suffix search order for resolving non-FQDNs:
xe pif-param-set uuid= \
“other-config:domain=suffix1.com suffix2.com suffix3.com”
2. Configure the DNS server to use on your XenServer hosts:
xe pif-reconfigure-ip mode=static dns= ip= \
gateway= netmask= uuid=
3. Manually set the management interface to use a PIF that is on the same network as your
DNS server:
xe host-management-reconfigure pif-uuid=
Note:
External authentication is a per-host property. However, Citrix advises that you enable and
disable this on a per-pool basis – in this case XenServer will deal with any failures that occur
when enabling authentication on a particular host and perform any roll-back of changes that
may be required, ensuring that a consistent configuration is used across the pool. Use the
host-param-list command to inspect properties of a host and to determine the status of
external authentication by checking the values of the relevant fields.
Disabling external authentication
•
Use XenCenter to disable Active Directory authentication, or the following xe command:
xe pool-disable-external-auth
2.1.2. User Authentication
To allow a user access to your XenServer host, you must add a subject for that user or a group that they are in.
(Transitive group memberships are also checked in the normal way, for example: adding a subject for group A,
where group A contains group B and user 1 is a member of group B would permit access to user 1.) If
you wish to manage user permissions in Active Directory, you could create a single group that you then add and
6
remove users to/from; alternatively, you can add and remove individual users from XenServer, or a combination
of users and groups as your would be appropriate for your authentication requirements. The subject list can be
managed from XenCenter or using the CLI as described below.
When authenticating a user, the credentials are first checked against the local root account, allowing you to
recover a system whose AD server has failed. If the credentials (i.e. username then password) do not match/
authenticate, then an authentication request is made to the AD server – if this is successful the user's information
will be retrieved and validated against the local subject list, otherwise access will be denied. Validation against the
subject list will succeed if the user or a group in the transitive group membership of the user is in the subject list.
Note:
When using Active Directory groups to grant access for Pool Administrator users who will
require host ssh access, the number of users in the Active Directory group must not exceed
500.
Allowing a user access to XenServer using the CLI
•
To add an AD subject to XenServer:
xe subject-add subject-name=
The entity name should be the name of the user or group to which you want to grant access. You may
optionally include the domain of the entity (for example, '' as opposed to '') although
the behavior will be the same unless disambiguation is required.
Using the CLI to Revoke User Access
1.
Find the user's subject identifier. This is the user or the group containing the user (removing a group would
remove access to all users in that group, providing they are not also specified in the subject list). To do this
use the subject list command:
xe subject-list
This returns a list of all users.
You may wish to apply a filter to the list, for example to find the subject identifier for a user named user1
in the testad domain, you could use the following command:
xe subject-list other-config:subject-name=''
2.
Remove the user using the subject-remove command, passing in the subject identifier you learned in the
previous step:
xe subject-remove subject-uuid=
3.
You may wish to terminate any current session this user has already authenticated. See Terminating all
authenticated sessions using xe and Terminating individual user sessions using xe for more information about
terminating sessions. If you do not terminate sessions the users whose permissions have been revoked may
be able to continue to access the system until they log out.
Listing subjects with access
•
To identify the list of users and groups with permission to access your XenServer host or pool, use the
following command:
xe subject-list
2.1.3. Removing Access for a User
Once a user is authenticated, they will have access to the server until they end their session, or another user
terminates their session. Removing a user from the subject list, or removing them from a group that is in the
7
subject list, will not automatically revoke any already-authenticated sessions that the user has; this means that
they may be able to continue to access the pool using XenCenter or other API sessions that they have already
created. In order to terminate these sessions forcefully, XenCenter and the CLI provide facilities to terminate
individual sessions, or all currently active sessions. See the XenCenter help for more information on procedures
using XenCenter, or below for procedures using the CLI.
Terminating all authenticated sessions using xe
•
Execute the following CLI command:
xe session-subject-identifier-logout-all
Terminating individual user sessions using xe
1.
Determine the subject identifier whose session you wish to log out. Use either the session-subjectidentifier-list or subject-list xe commands to find this (the first shows users who have sessions, the second
shows all users but can be filtered, for example, using a command like xe subject-list other-config:subjectname=xendt\\user1 – depending on your shell you may need a double-backslash as shown).
2.
Use the session-subject-logout command, passing the subject identifier you have determined in the
previous step as a parameter, for example:
xe session-subject-identifier-logout subject-identifier=
2.1.4. Leaving an AD Domain
Warning:
When you leave the domain (that is, disable Active Directory authentication and disconnect
a pool or server from its domain), any users who authenticated to the pool or server with
Active Directory credentials are disconnected.
Use XenCenter to leave an AD domain. See the XenCenter help for more information. Alternately run the pooldisable-external-auth command, specifying the pool uuid if required.
Note:
Leaving the domain will not cause the host objects to be removed from the AD database. See
this knowledge base article for more information about this and how to remove the disabled
host entries.
2.2. Role Based Access Control
XenServer's Role Based Access Control (RBAC) allows you to assign users, roles, and permissions to control who
has access to your XenServer and what actions they can perform. The XenServer RBAC system maps a user
(or a group of users) to defined roles (a named set of permissions), which in turn have associated XenServer
permissions (the ability to perform certain operations).
As users are not assigned permissions directly, but acquire them through their assigned role, management of
individual user permissions becomes a matter of simply assigning the user to the appropriate role; this simplifies
common operations. XenServer maintains a list of authorized users and their roles.
RBAC allows you to easily restrict which operations different groups of users can perform- thus reducing the
probability of an accident by an inexperienced user.
To facilitate compliance and auditing, RBAC also provides an Audit Log feature.
8
RBAC depends on Active Directory for authentication services. Specifically, XenServer keeps a list of authorized
users based on Active Directory user and group accounts. As a result, you must join the pool to the domain and
add Active Directory accounts before you can assign roles.
The local super user (LSU), or root, is a special user account used for system administration and has all rights or
permissions. In XenServer, the local super user is the default account at installation. The LSU is authenticated via
XenServer and not external authentication service, so if the external authentication service fails, the LSU can still
log in and manage the system. The LSU can always access the XenServer physical host via SSH.
RBAC process
This is the standard process for implementing RBAC and assigning a user or group a role:
1. Join the domain. See Enabling external authentication on a pool
2. Add an Active Directory user or group to the pool. This becomes a subject. See Section 2.2.3.3, “To Add a
Subject to RBAC”.
3. Assign (or modify) the subject's RBAC role. See Section 2.2.3.4, “To Assign an RBAC Role to a Created subject”.
2.2.1. Roles
XenServer is shipped with the following six, pre-established roles:
•
Pool Administrator (Pool Admin) – the same as being the local root. Can perform all operations.
Note:
The local super user (root) will always have the "Pool Admin" role. The Pool Admin role has
the same permissions as the local root.
•
Pool Operator (Pool Operator) – can do everything apart from adding/removing users and modifying their
roles. This role is focused mainly on host and pool management (i.e. creating storage, making pools, managing
the hosts etc.)
•
Virtual Machine Power Administrator (VM Power Admin) – creates and manages Virtual Machines. This role
is focused on provisioning VMs for use by a VM operator.
•
Virtual Machine Administrator (VM Admin) – similar to a VM Power Admin, but cannot migrate VMs or
perform snapshots.
•
Virtual Machine Operator (VM Operator) – similar to VM Admin, but cannot create/destroy VMs – but can
perform start/stop lifecycle operations.
•
Read-only (Read Only) – can view resource pool and performance data.
Note:
You cannot add, remove or modify roles in this version of XenServer.
Warning:
9
You can not assign the role of pool-admin to an AD group which has more than 500 members,
if you want users of the AD group to have SSH access.
For a summary of the permissions available for each role and more detailed information on the operations
available for each permission, see Section 2.2.2, “Definitions of RBAC Roles and Permissions”.
All XenServer users need to be allocated to an appropriate role. By default, all new users will be allocated to the
Pool Administrator role. It is possible for a user to be assigned to multiple roles; in that scenario, the user will
have the union of all the permissions of all their assigned roles.
A user's role can be changed in two ways:
1. Modify the subject -> role mapping (this requires the assign/modify role permission, only available to a Pool
Administrator.)
2. Modify the user's containing group membership in Active Directory.
2.2.2. Definitions of RBAC Roles and Permissions
The following table summarizes which permissions are available for each role. For details on the operations
available for each permission, see Definitions of permissions.
Table 2.1. Permissions available for each role
Role permissions
Pool
Admin
Pool
Operator
Assign/modify roles
X
Log in to (physical) server
consoles (through SSH and
XenCenter)
X
Server backup/restore
X
Import/export
OVF/OVA
packages and disk images
X
Set cores per socket
X
Convert virtual machines using
XenServer Conversion Manager
X
Switch-port locking
X
X
Log out active user connections
X
X
Create and dismiss alerts
X
X
Cancel task of any user
X
X
Pool management
X
X
Storage XenMotion
X
X
X
VM advanced operations
X
X
X
VM create/destroy operations
X
X
X
X
VM change CD media
X
X
X
X
10
VM Power
Admin
VM
Admin
VM
Operator
X
Read
Only
Role permissions
Pool
Admin
Pool
Operator
VM Power
Admin
VM
Admin
VM
Operator
Read
Only
VM change power state
X
X
X
X
X
View VM consoles
X
X
X
X
X
XenCenter view management
operations
X
X
X
X
X
Cancel own tasks
X
X
X
X
X
X
Read audit logs
X
X
X
X
X
X
Connect to pool and read all pool
metadata
X
X
X
X
X
X
Configure virtual GPU
X
X
View virtual GPU configuration
X
X
X
X
X
X
Access the config drive (CoreOS
VMs only)
X
Container management
X
Health Check configuration
X
X
View Health Check results and
settings
X
X
X
X
X
X
Definitions of Permissions
The following table provides additional details about permissions:
Table 2.2. Definitions of permissions
Permission
Allows Assignee To
Rationale/Comments
Assign/modify roles
•
Add/remove users
•
Add/remove roles from users
•
Enable and disable Active
Directory integration (being
joined to the domain)
This permission lets the user grant
himself or herself any permission
or perform any task.
•
Server console access through
ssh
•
Server console access through
XenCenter
•
Back up and restore servers
•
Back up and restore pool
metadata
Log in to server consoles
Server backup/restore VM create/
destroy operations
11
Warning: This role lets the
user disable the Active Directory
integration and all subjects added
from Active Directory.
Warning: With access to a root
shell, the assignee could arbitrarily
reconfigure the entire system,
including RBAC.
The ability to restore a backup
lets the assignee revert RBAC
configuration changes.
Permission
Allows Assignee To
Rationale/Comments
Import/export OVF/OVA packages
and disk images
•
Import OVF and OVA packages
•
Import disk images
•
Export VMs
packages
Set cores-per-socket
•
Set the number of cores per
socket for the VM's virtual
CPUs
This permission enables the user to
specify the topology for the VM's
virtual CPUs.
Convert VMs using XenServer
Conversion Manager
•
Convert VMware
XenServer VMs
This permission lets the user
convert workloads from VMware
to XenServer by copying batches
of VMware VMs to XenServer
environment.
Switch-port locking
•
Control traffic on a network
Log out active user connections
•
Ability to disconnect logged in
users
as
OVF/OVA
VMs
to
Create/dismiss alerts
This permission lets the user to
block all traffic on a network
by default, or define specific IP
addresses from which a VM is
allowed to send traffic.
Warning: A user with this
permission can dismiss alerts for
the entire pool.
Note: The ability to view alerts is
part of the Connect to Pool and
read all pool metadata permission.
Cancel task of any user
•
Cancel any user's running task
12
This permission lets the user
request XenServer cancel an inprogress task initiated by any user.
Permission
Allows Assignee To
Rationale/Comments
Pool management
•
Set pool properties (naming,
default SRs)
•
Enable, disable, and configure
HA
This permission includes all the
actions required to maintain a
pool.
•
Set per-VM
priorities
•
Configure DR and perform
DR failover, failback and test
failover operations
•
Enable, disable, and configure
Workload Balancing (WLB)
•
Add and remove server from
pool
•
Emergency
master
•
Emergency master address
•
Emergency recover slaves
•
Designate new master
•
Manage pool
certificates
•
Patching
•
Set server properties
•
Configure server logging
•
Enable and disable servers
•
Shut down, reboot,
power-on servers
•
Restart toolstack
•
System status reports
•
Apply license
•
Live migration of all other VMs
on a server to another server,
due to either Maintenance
Mode, or HA
•
Configure server management
interface
and
secondary
interfaces
•
Disable server management
•
Delete crashdumps
•
Add, edit,
networks
•
Add, edit, and remove PBDs/
PIFs/VLANs/Bonds/SRs
•
Add, remove, and retrieve
secrets
HA
restart
transition
13
and
and
to
server
and
remove
Note: If the management interface
is not functioning, no logins can
authenticate except local root
logins.
Permission
Allows Assignee To
Storage XenMotion
•
Migrate VMs from one host to
another host
•
Move Virtual Disk (VDIs) from
one SR to another SR
•
Adjust VM memory (through
Dynamic Memory Control)
•
Create a VM snapshot with
memory, take VM snapshots,
and roll-back VMs
•
Migrate VMs
•
Start VMs, including specifying
physical server
•
Resume VMs
•
Install or delete
•
Clone/copy VMs
•
Add, remove, and configure
virtual disk/CD devices
•
Add, remove, and configure
virtual network devices
•
Import/export XVA files
•
VM configuration change
•
Eject current CD
•
Insert new CD
•
Start
VMs
placement)
•
Shut down VMs
•
Reboot VMs
•
Suspend VMs
•
Resume VMs
placement)
•
See and interact with VM
consoles
This permission does not let the
user view server consoles.
•
Create and modify global
XenCenter folders
•
Create and modify global
XenCenter custom fields
Folders, custom fields, and
searches are shared between all
users accessing the pool
•
Create and modify global
XenCenter searches
•
Lets a user cancel their own
tasks
VM advanced operations
VM create/destroy operations
VM change CD media
VM change power state
View VM consoles
XenCenter
operations
view
Cancel own tasks
management
14
Rationale/Comments
This permission provides the
assignee with enough privileges to
start a VM on a different server
if they are not satisfied with the
server XenServer selected.
Server backup/restore VM create/
destroy operations
Import/export OVF/OVA packages;
import disk images
(automatic
This permission does not include
start_on, resume_on, and migrate,
which are part of the VM advanced
operations permission.
(automatic
Permission
Allows Assignee To
Read audit log
•
Download the XenServer audit
log
Connect to pool and read all pool
metadata
•
Log in to pool
•
View pool metadata
•
View historical performance
data
•
View logged in users
•
View users and roles
•
View messages
•
Register for and receive events
•
Specify a pool-wide placement
policy
•
Assign a virtual GPU to a VM
•
Remove a virtual GPU from a
VM
•
Modify allowed virtual GPU
types
•
Create, destroy, or assign a
GPU group
View virtual GPU configuration
•
View GPUs, GPU placement
policies, and virtual GPU
assignments
Access the config drive (CoreOS
VMs only)
•
Access the config driver of the
VM
•
Modify
the
parameters
•
Start
•
Stop
•
Pause
•
Resume
•
Access information about the
container
•
Enable Health Check
•
Disable Health Check
•
Update Health Check settings
•
Manually upload a server
status report
•
View the results of a Health
Check upload
•
View Health Check enrollment
settings
Configure virtual GPU
Container management
Health Check configuration
View Health Check results and
settings
15
Rationale/Comments
cloud-config
Note:
In some cases, a Read Only user cannot move a resource into a folder in XenCenter, even after
receiving an elevation prompt and supplying the credentials of a more privileged user. In this
case, log on to XenCenter as the more privileged user and retry the action.
2.2.3. Using RBAC with the CLI
2.2.3.1. To List All the Available Defined Roles in XenServer
•
Run the command: xe role-list
This command returns a list of the currently defined roles, for example:
uuid( RO): 0165f154-ba3e-034e-6b27-5d271af109ba
name ( RO): pool-admin
description ( RO): The Pool Administrator role has full access to all
features and settings, including accessing Dom0 and managing subjects,
roles and external authentication
uuid ( RO): b9ce9791-0604-50cd-0649-09b3284c7dfd
name ( RO): pool-operator
description ( RO): The Pool Operator role manages host- and pool-wide resources,
including setting up storage, creating resource pools and managing patches, and
high availability (HA).
uuid( RO): 7955168d-7bec-10ed-105f-c6a7e6e63249
name ( RO): vm-power-admin
description ( RO): The VM Power Administrator role has full access to VM and
template management and can choose where to start VMs and use the dynamic memory
control and VM snapshot features
uuid ( RO): aaa00ab5-7340-bfbc-0d1b-7cf342639a6e
name ( RO): vm-admin
description ( RO): The VM Administrator role can manage VMs and templates
uuid ( RO): fb8d4ff9-310c-a959-0613-54101535d3d5
name ( RO): vm-operator
description ( RO): The VM Operator role can use VMs and interact with VM consoles
uuid ( RO): 7233b8e3-eacb-d7da-2c95-f2e581cdbf4e
name ( RO): read-only
description ( RO): The Read-Only role can log in with basic read-only access
Note:
This list of roles is static; it is not possible to add, remove, or modify roles.
2.2.3.2. To Display a List of Current Subjects:
•
Run the command xe subject-list
This will return a list of XenServer users, their uuid, and the roles they are associated with:
16
uuid ( RO): bb6dd239-1fa9-a06b-a497-3be28b8dca44
subject-identifier ( RO): S-1-5-21-1539997073-1618981536-2562117463-2244
other-config (MRO): subject-name: example01\user_vm_admin; subject-upn: \
user_vm_admin@XENDT.NET; subject-uid: 1823475908; subject-gid: 1823474177; \
subject-sid: S-1-5-21-1539997073-1618981536-2562117463-2244; subject-gecos: \
user_vm_admin; subject-displayname: user_vm_admin; subject-is-group: false; \
subject-account-disabled: false; subject-account-expired: false; \
subject-account-locked: false;subject-password-expired: false
roles (SRO): vm-admin
uuid ( RO): 4fe89a50-6a1a-d9dd-afb9-b554cd00c01a
subject-identifier ( RO): S-1-5-21-1539997073-1618981536-2562117463-2245
other-config (MRO): subject-name: example02\user_vm_op; subject-upn: \
user_vm_op@XENDT.NET; subject-uid: 1823475909; subject-gid: 1823474177; \
subject-sid: S-1-5-21-1539997073-1618981536-2562117463-2245; \
subject-gecos: user_vm_op; subject-displayname: user_vm_op; \
subject-is-group: false; subject-account-disabled: false; \
subject-account-expired: false; subject-account-locked: \
false; subject-password-expired: false
roles (SRO): vm-operator
uuid ( RO): 8a63fbf0-9ef4-4fef-b4a5-b42984c27267
subject-identifier ( RO): S-1-5-21-1539997073-1618981536-2562117463-2242
other-config (MRO): subject-name: example03\user_pool_op; \
subject-upn: user_pool_op@XENDT.NET; subject-uid: 1823475906; \
subject-gid: 1823474177; subject-s id:
S-1-5-21-1539997073-1618981536-2562117463-2242; \
subject-gecos: user_pool_op; subject-displayname: user_pool_op; \
subject-is-group: false; subject-account-disabled: false; \
subject-account-expired: false; subject-account-locked: \
false; subject-password-expired: false
roles (SRO): pool-operator
2.2.3.3. To Add a Subject to RBAC
In order to enable existing AD users to use RBAC, you will need to create a subject instance within XenServer,
either for the AD user directly, or for one of their containing groups:
1. Run the command xe subject-add subject-name=
This adds a new subject instance.
2.2.3.4. To Assign an RBAC Role to a Created subject
Once you have added a subject, you can assign it to an RBAC role. You can refer to the role by either its uuid
or name:
1. Run the command:
xe subject-role-add uuid= role-uuid=
or
xe subject-role-add uuid= role-name=
For example, the following command adds a subject with the uuid b9b3d03b-3d10-79d3-8ed7a782c5ea13b4 to the Pool Administrator role:
xe subject-role-add uuid=b9b3d03b-3d10-79d3-8ed7-a782c5ea13b4 role-name=pool-admin
2.2.3.5. To Change a Subject's RBAC Role:
To change a user's role it is necessary to remove them from their existing role, and add them to a new role:
17
1. Run the commands:
xe subject-role-remove uuid= role-name= \
xe subject-role-add uuid= role-name= \
To ensure that the new role takes effect, the user should be logged out and logged back in again (this requires
the "Logout Active User Connections" permission - available to a Pool Administrator or Pool Operator).
Warning:
Once you have added or removed a pool-admin subject, there can be a delay of a few seconds
for ssh sessions associated to this subject to be accepted by all hosts of the pool.
2.2.4. Auditing
The RBAC audit log will record any operation taken by a logged-in user.
•
the message will explicitly record the Subject ID and user name associated with the session that invoked the
operation.
•
if an operation is invoked for which the subject does not have authorization, this will be logged.
•
if the operation succeeded then this is recorded; if the operation failed then the error code is logged.
2.2.4.1. Audit Log xe CLI Commands
xe audit-log-get [since=] filename=