From e0bf44d83e02900f9e3004a9dac6a9ddcb9b2d41 Mon Sep 17 00:00:00 2001 From: Magnus Andersson Date: Tue, 16 Jan 2024 10:37:38 +0100 Subject: [PATCH] README.md: Add description on how to do a online volume resize --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index d90fa00..1c14c71 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ The following tasks is executed by this playbook. - Create an network port for each node and use a selection of the queried security groups. - Create an instance with os volume, snap volume and port attached and a custom cloudinit config. +Auth is provided to the playbook by environment variables. +Source the rc file of app credentials for the desired openstack project. + ## Cloudinit config. Cloudinit does the following tasks. @@ -18,3 +21,16 @@ Cloudinit does the following tasks. - Configure Chronyd to use netnod.se as a source. - Configure a lvol_snap LVM volume and format it with XFS. - Add a mount record of the lvm volume in fstab and verifies it. + +## Expansion of volume by online resize + +To expand the attached snap volume first query the api version of the volume endpoint from the management node and set the new size of the volume. +- curl -L https://v2.api.dco.safedc.net:8776/ | jq '.versions[1].version' # Returns 3.60 +- openstack --os-volume-api-version 3.60 volume set --size 30 6f1a238d-f746-4604-92c9-0985ad4b83fd + +From inside the instance run the following commands. +- sudo pvresize /dev/sdb +- sudo lvresize -l +100%FREE snapvg/lvol_snap +- sudo xfs_growfs /dev/snapvg/lvol_snap + +Now we have expanded the mounted device with zero downtime.