This repository is Maintained meaning that this software is supported by Packet and its community - available to use in production environments.
This utility/helper script is made available to assist in the attachment and detachment of Packet block storage volumes and is currently in testing. Use at your own risk and always have a backup/snapshot just in case!
The packet-block storage helper scripts are pre-installed on the following Packet operating systems:
- CentOS
- Ubuntu
- Debian
- OpenSUSE
- Redhat Enterprise Linux
- SLES 12 SP3
- Attach block storage block devices
- Detach block storage block devices
- Configure multipath for HA
- Validate block device creation
Ubuntu/Debian:
apt-get install open-iscsi multipath-tools jq
CentOS:
yum -y install iscsi-initiator-utils device-mapper-multipath jq
Using git:
sudo su -
git clone [email protected]:packethost/packet-block-storage.git
cp ./packet-block-storage/packet-block-storage-* /usr/bin/
chmod u+x /usr/bin/packet-block-storage-*
or
Using wget
sudo su -
wget -O /usr/bin/packet-block-storage-attach https://raw.githubusercontent.com/packethost/packet-block-storage/master/packet-block-storage-attach
wget -O /usr/bin/packet-block-storage-detach https://raw.githubusercontent.com/packethost/packet-block-storage/master/packet-block-storage-detach
chmod u+x /usr/bin/packet-block-storage-*
Attach a volume
- Create a volume under the Storage tab in your Packet.net portal account
- Click on the storage volume, select the server you wish to attach the volume to and click on Attach.
- Execute packet-block-storage-attach from within the OS on the server in question
- Partition the block device at /dev/mapper/{volume_name_here} disk using parted, fdisk, etc
- Make a filesystem on the block device
- Mount the block device on the mount point of you choice
Example :
[root@cent7-pbs-client dlaube]# packet-block-storage-attach
Block device /dev/mapper/volume-9ab99df5 is available for use
Block device /dev/mapper/volume-7eab8fc1 is available for use
IMPORTANT NOTE: Consider using the "-m queue" flag when attaching storage to configure multipath queuing. If block storage becomes unreachable, the option "fail" results in FS read-only and "queue" will keep IO in memory buffer until reachable. See "-h" for usage details.
Detach a volume
- Unmount the filesystem on any block storage volume that may be in use
- Execute packet-block-storage-detach from within the OS on the server in question
- Click on the storage volume from the storage tab within your Packet.net project and click on Detach
Example:
[root@cent7-pbs-client dlaube]# packet-block-storage-detach