Adding NFS shared storage to a resource pool using the CLI

1.Open a console on any XenServer host in the pool.

2.Create the storage repository on <server:/path> by issuing the command

xe sr-create content-type=user type=nfs name-label=<"Example SR"> shared=true \ device-config:server=<server>\

device-config:serverpath=<path>

The device-config:serverrefers to the hostname of the NFS server and device- config:serverpath refers to the path on the NFS server. Since shared is set to true, the shared storage will be automatically connected to every XenServer host in the pool and any XenServer hosts that subsequently join will also be connected to the storage. The Universally Unique Identifier (UUID) of the created storage repository will be printed on the screen.

3.Find the UUID of the pool by the command xe pool-list

4.Set the shared storage as the pool-wide default with the command xe pool-param-set uuid=<pool_uuid> default-SR=<sr_uuid>

Since the shared storage has been set as the pool-wide default, all future VMs will have their disks created on shared storage by default. See Storage for information about creating other types of shared storage.

Removing a XenServer host from a resource pool

When a XenServer host is removed (ejected) from a pool, the machine is rebooted, reinitialized, and left in a state equivalent to that after a fresh installation. It is important not to eject a XenServer host from a pool if there is important data on the local disks.

To remove a host from a resource pool using the CLI

1.Open a console on any host in the pool.

2.Find the UUID of the host by running the command xe host-list

3.Eject the required host from the pool:

xe pool-eject host-uuid=<host_uuid>

The XenServer host will be ejected and left in a freshly-installed state.

Warning:

Do not eject a host from a resource pool if it contains important data stored on its local disks. All of the data will be erased upon ejection from the pool. If you wish to preserve this data, copy the VM to shared storage on the pool first using XenCenter, or the xe vm-copyCLI command.

When a XenServer host containing locally stored VMs is ejected from a pool, those VMs will still be present in the pool database and visible to the other XenServer hosts. They will not start until the virtual disks associated with them have been changed to point at shared storage which can be seen by other XenServer hosts in the pool, or simply removed. It is for this reason that you are strongly advised to move any local storage to shared storage upon joining a pool, so that individual XenServer hosts can be ejected (or physically fail) without loss of data.

22

Page 42
Image 42
Citrix Systems 5.6 Removing a XenServer host from a resource pool, To remove a host from a resource pool using the CLI