ResizingVMDisk: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 31: | Line 31: | ||
2. To resize the image: | 2. To resize the image: | ||
<pre>qemu-img resize rbd:{pool-name}/{image-name} {size}</pre> | <pre>qemu-img resize rbd:{pool-name}/{image-name}:id=libvirt {size}</pre> |
Revision as of 13:23, 12 October 2022
Goal
On this page, we will explain how to increase the size of a partition in a VM. The steps are the following:
- Increase the size of the image
- Increase the size of a partition
- Resize the filesystem
The details of the steps of this generic procedure will change depending on:
- the type of backend storage (ONE datastore) for VM images (NFS share or Ceph);
- the format of the image (qcow2, raw,...);
- the type of partition (standard partitioning or LVM);
- the type of filesystem (xfs, ext3/4,...).
qcow2 images on NFS with a standard partition in ext4
1. Poweroff the VM
2. On the frontend of the ONE cloud, find the full path of the image of the VM with the command:
oneimage show <image_id>
3. Resize the image:
qemu-img resize <path_of_image> +<number>GB
4. Restart the VM and login into it
5. Install the following packages:
yum install cloud-utils-growpart gdisk
6. Resize the partition:
growpart <device> <partition_number> +<number>GB
7. Resize the filesystem of the partition:
resize2fs <partition>
raw images on Ceph with standard ext4 partition
1. Poweroff the VM
2. To resize the image:
qemu-img resize rbd:{pool-name}/{image-name}:id=libvirt {size}