PSTORAGE−HOTPLUG

NAME
DESCRIPTION
AUTHOR
SEE ALSO

NAME

pstorage-hotplug − Overview of Parallels Cloud Storage hotplug capabilities.

DESCRIPTION

Maintaining a large cluster with many hosts and multiple HDDs per host requires a simple automated solution to easily add new and replace failed HDDs.

Linux has had support for handling such tasks for a long time. In Linux, each time an HDD is inserted or removed, the kernel generates an event which is passed to the udev device manager that allows the system to process the event further.

pstorage−hotplug is a set of scripts which use udev and enable you to automatically create and start a CS on an HDD hot plug event and stop a CS on an HDD hot unplug event (stopped CSes need to be deleted manually). The HDDs in question must be detected by the operating system. For information on support for hardware RAID controllers, see Hardware RAID Controllers Compatibility below.

Warning: Special considerations apply to sharing SSD write cache between running CSes. This functionality is not implemented yet, so CSes with journals will not be started automatically on disk hotplug.

Note: You cannot manage metadata servers with the pstorage−hotplug scripts.

Configuring Hotplug
You can configure how hotplug events are handled by setting the following parameters in /etc/pstorage/hotplug.config:

ENABLE_HOTPLUG

Mandatory. Enables or disables hotplug support. To enable, set to "yes".

HOTPLUG_CLUSTER

Mandatory. Name of the cluster for which the new CSes will be configured.

HOTPLUG_TIER

Sets the tier for new CSes.

HOTPLUG_LOG_FILE

Hotplug event log.

HOTPLUG_MOUNT_PATH

Hotplug mount path.

Disk Hot Plug Sequence
When you connect an HDD while hotplug is enabled, the following happens:

1. The new HDD is detected. If it does not have a partition table or has an empty partition table, a single partition spanning the entire HDD is created, formatted to ext4, and labelled "pstorage−hotplug". Otherwise the HDD is ignored.

2. The partition labelled "pstorage−hotplug" is detected, mounted to a unique location, and checked for an existing CS on it.

Note: Such a partition can be created either automatically (see the first step above) or manually (see "Manual Disk Partitioning" below).

3. If a CS is found, it is added to the list of CSes on this host and started. Otherwise, a new CS is created for the specified cluster and started.

Disk Hot Unplug Sequence
When you disconnect an HDD while hotplug is enabled, the following happens:

1. The HDD removal is detected.

2. All CSes running on the HDD are automatically stopped, and the HDD is logically unmounted.

Note: If you unplugged a wrong HDD, just plug it back and the CSes on it will automatically restart.

Manual Disk Partitioning
If you need to partition a disk manually, you can use these commands (assuming /dev/sdb is the target disk):

1. Create a new partition table:

parted /dev/sdb mklabel gpt

2. Create a new partition:

parted /dev/sdb mkpart primary 0 −0

3. Format the new partition to ext4 with our "magic" label:

mkfs.ext4 −L pstorage−hotplug /dev/sdb1

4. Configure a mount point for this partition in /etc/fstab:

/dev/sdb1 /mnt ext4 defaults 0 0

5. Mount the partition:

mount /dev/sdb1 /mnt

6. Create a CS at /mnt/cs, or move an existing CS, or leave it to automatic CS creation on next replug. Example:

pstorage −c $HOTPLUG_CLUSTERmake−cs −r /mnt/cs

Hardware RAID Controllers Compatibility
Hot plugging and unplugging of RAID arrays requires that the hardware RAID controller work in the passthrough mode. Of controllers for which the passthrough mode cannot be enabled, only those based on LSI chips are currently supported. To enable such support, start the pstorage−hotplugd daemon. It will automatically create logical volumes (which are, in fact, single−drive RAID0 arrays) for newly inserted drives. The daemon will also import existing logical volumes labelled "pstorage".

Note: Restart the pstorage−hotplugd daemon each time you change the ENABLE_HOTPLUG variable in the configuration file:

service pstorage−hotplugd restart

AUTHOR

Copyright © 2011−2013, Parallels, Inc. All rights reserved.

SEE ALSO

pstorage(1), pstorage−make−cs(1), csd(1), pstorage−overview(7), udev(7), fstab(5)