From 9508bc76ca2a4df10bee501a1c0bce5f17ddef8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kone=C4=8Dn=C3=BD?= Date: Wed, 1 Sep 2021 15:09:46 +0200 Subject: [PATCH] Review guestdisk SOP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Konečný --- modules/sysadmin_guide/nav.adoc | 2 +- modules/sysadmin_guide/pages/guestdisk.adoc | 32 ++++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/modules/sysadmin_guide/nav.adoc b/modules/sysadmin_guide/nav.adoc index 6adea96..782720a 100644 --- a/modules/sysadmin_guide/nav.adoc +++ b/modules/sysadmin_guide/nav.adoc @@ -43,7 +43,7 @@ ** xref:github2fedmsg.adoc[github2fedmsg - SOP] ** xref:github.adoc[Using github for Infra Projects - SOP] ** xref:greenwave.adoc[Greenwave - SOP] -** xref:guestdisk.adoc[guestdisk - SOP in review ] +** xref:guestdisk.adoc[Guest Disk Resize - SOP] ** xref:guestedit.adoc[guestedit - SOP in review ] ** xref:haproxy.adoc[haproxy - SOP in review ] ** xref:hotfix.adoc[hotfix - SOP in review ] diff --git a/modules/sysadmin_guide/pages/guestdisk.adoc b/modules/sysadmin_guide/pages/guestdisk.adoc index 3029665..d98bc54 100644 --- a/modules/sysadmin_guide/pages/guestdisk.adoc +++ b/modules/sysadmin_guide/pages/guestdisk.adoc @@ -4,14 +4,9 @@ Resize disks in our kvm guests == Contents -[arabic] -. Contact Information -. How to do it - -____ -[arabic] -. KVM/libvirt Guests -____ +* <<_contact_information>> +* <<_how_to_do_it>> +** <<_kvmlibvirt_guests>> == Contact Information @@ -31,26 +26,27 @@ Purpose::: === KVM/libvirt Guests [arabic] -. {blank} -+ -SSH to the kvm server and resize the guest's logical volume. If you:: +. SSH to the kvm server and resize the guest's logical volume. If you want to be extra careful, make a snapshot of the LV first: - + ++ .... lvcreate -n [guest name]-snap -L 10G -s /dev/VolGroup00/[guest name] .... - + - Optional, but always good to be careful ++ +Optional, but always good to be careful + . Shutdown the guest: + .... sudo virsh shutdown [guest name] .... + . Disable the guests lv: + .... lvchange -an /dev/VolGroup00/[guest name] .... + . Resize the lv: + .... @@ -66,6 +62,7 @@ lvresize -L +XG /dev/VolGroup00/[guest name] .... lvchange -ay /dev/VolGroup00/[guest name] .... + . Bring the guest back up: + .... @@ -77,11 +74,13 @@ sudo virsh start [guest name] sudo virsh console [guest name] You may wish to boot single user mode to avoid services coming up and going down again .... + . On the guest, run: + .... fdisk /dev/vda .... + . Delete the the LVM partition on the guest you want to add space to and recreate it with the maximum size. Make sure to set its type to LV (8e): + @@ -92,11 +91,13 @@ n to create new partition (default values should be ok) t to change partition type (set to 8e) w to write changes .... + . Run partprobe: + .... partprobe .... + . Check the size of the partition: + .... @@ -105,11 +106,13 @@ fdisk -l /dev/vdaN + If this still reflects the old size, then reboot the guest and verify that its size changed correctly when it comes up again. + . Login to the guest again, and run: + .... pvresize /dev/vdaN .... + . A vgs should now show the new size. Use lvresize to resize the root lv: + @@ -118,6 +121,7 @@ lvresize -L [new root partition size]G /dev/GuestVolGroup00/root (pvs will tell you how much space is available) .... + . Finally, resize the root partition: + ....