I would like to use the generic cloud image as foundation for a LAMP virtual guest.
By default, the root partition is small and will not have enough storage space for files etc.
I never used a cloud image before, how to enlarge the storage space in an image?
Thanks for any hints / tips!
Generic cloud image - how to add storage?
Re: Generic cloud image - how to add storage?
First you have resize image of hdd.
qemu-img resize CentOS-7-x86_64-GenericCloud.qcow2 +2GB
And next resize
# fdisk /dev/vda
next: n ; p ; 3 ; enter ; enter ; t ; 3 ; 8e ; w ( new, primary, number of partition, first-last cilinder, change type, number of partition, type 8e [LVM], write )
next restart system:
next:
# pvcreate /dev/vda3
# vgs to display name of group
# vgextend centos /dev/vda3
# lvdisplay to show logical volume path
# lvextend /dev/centos/root /dev/vda3
and finally :
# xfs_growfs /dev/centos/root
and check size of :
# lsblk
qemu-img resize CentOS-7-x86_64-GenericCloud.qcow2 +2GB
And next resize
# fdisk /dev/vda
next: n ; p ; 3 ; enter ; enter ; t ; 3 ; 8e ; w ( new, primary, number of partition, first-last cilinder, change type, number of partition, type 8e [LVM], write )
next restart system:
next:
# pvcreate /dev/vda3
# vgs to display name of group
# vgextend centos /dev/vda3
# lvdisplay to show logical volume path
# lvextend /dev/centos/root /dev/vda3
and finally :
# xfs_growfs /dev/centos/root
and check size of :
# lsblk
Re: Generic cloud image - how to add storage?
Or just add another disk to the VM and mount it in the appropriate place ....
Re: Generic cloud image - how to add storage?
Project has been stalled for a while, will pick it up again now. Thanks for the reply mhge!
How would a cloud service / server tackle that problem? They have an automated way to grow/deploy the cloud images?
How would a cloud service / server tackle that problem? They have an automated way to grow/deploy the cloud images?
Re: Generic cloud image - how to add storage?
I believe cloud-init is installed and runs on the images and has the ability to auto-resize to the full size of the disk image given.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Generic cloud image - how to add storage?
The only thing I don't like about the cloud image provided is that it's made of one single partition so if you have run-away logs (in /var/log, for example), it could render the system unusable.
I'm looking at the cloud-init disk_setup module but I don't think it can resize existing images (such as the single partition in the centos cloud image) without losing data. Obviously, we can always attach additional storage but would be nice if that wasn't the case.
I'm looking at the cloud-init disk_setup module but I don't think it can resize existing images (such as the single partition in the centos cloud image) without losing data. Obviously, we can always attach additional storage but would be nice if that wasn't the case.