Help:Adding Disk Space to Cloud VPS instances
This page explains how to add additional disk space to your Cloud VPS instance.
Cinder: Attachable Block Storage for Cloud VPS
Cloud VPS provides attachable block storage for VMs via the OpenStack Cinder component. A Cinder volume is created separately from a VM; it can then be 'attached' to a VM, formatted, and mounted within that VM's filesystem. A Cinder volume can also be detached and re-attached to a different VM and will persist after any associated VM is deleted.
Volumes can be created, deleted, expanded, and attached via the 'Volumes' tab in Horizon.
To add storage to a cloud-vps instance under
- Create a volume in the Horizon Volumes interface with the 'Create Volume' button. Set name, size, and description. Leave the other settings as defaults.
- Attach that volume to your instance using the 'Manage Attachements' action in Horizon.
- On the VM, run
user@cloud-vm:~$ sudo wmcs-prepare-cinder-volume This tool will partition, format, and mount a block storage device. Attached storage devices: vda: the primary volume containing / vdb: already contains ext4 filesystem vdc: The only block device device available to mount is vdc. Selecting. Where would you like to mount it? </srv> /extrastorage Ready to prepare and mount vdc on /extrastorage. OK to continue? <Y|n> Formatting as ext4... mke2fs 1.44.5 (15-Dec-2018) Creating filesystem with 1048576 4k blocks and 262144 inodes Filesystem UUID: 116f7a72-1e26-4ca1-b546-fd7015632900 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736 Allocating group tables: done Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done Mounting on /extrastorage... Updating fstab with UUID=116f7a72-1e26-4ca1-b546-fd7015632900 /extrastorage ext4 nofail,x-systemd.device-timeout=2s 0 2 ... Done.
wmcs-prepare-cinder-volume script is useful for setting up new Cinder devices. It will format and mount the new volume and add an entry to
/etc/fstab so that the volume is re-mounted after a reboot.
This tool is only useful for newly-created block devices. It can not be used to reattach formatted volumes or move volumes between instances.
user@cloud-vm:~$ sudo wmcs-prepare-cinder-volume This tool will partition, format, and mount a block storage device. Attached storage devices: vda: the primary volume containing / vdb: vdd: vde: already contains ext4 filesystem What device would you like to format and mount? <vdb>
Detecting available volumes
lsblk tool is useful for locating available devices and volumes and seeing where they're mounted. Typically, your instance's root drive will be
vda; other attached volumes will be
user@cloud-vm:~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 254:0 0 20G 0 disk ├─vda1 254:1 0 1007.5K 0 part ├─vda2 254:2 0 19G 0 part / └─vda3 254:3 0 1023M 0 part vdb 254:16 0 1G 0 disk /moreofmydata vdd 254:48 0 1G 0 disk vde 254:64 0 1G 0 disk
Extend a volume
Volumes can be extended using the 'Extend Volume' action in Horizon. This option is only available for volumes that are not currently attached to an instance.
Once the volume has been extended and re-attached to an instance, the filesystem must be resized. Remount on your VM, check the device name (with
lsblk), and then resize with
user@cloud-vm:~$ sudo resize2fs /dev/vdc resize2fs 1.44.5 (15-Dec-2018) Filesystem at /dev/vdc is mounted on /extrastorage; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 The filesystem on /dev/vdc is now 2097152 (4k) blocks long.
The default block storage quota for a project is 80Gb. To request additional quota for your project, open a quota request ticket in Phabricator. Most reasonable requests will be granted within 7 days.
With LVM (deprecated as of February, 2021)
|This information is outdated.|
|The following content has been placed in a collapsed box for improved usability.|
Storage quota on Cloud VPS instances
Cloud VPS instances have a maximum storage quota based on the size of the instance. By default only 20G of the allowed quota is allocated to the instance as the
The additional space is allocated to /srv. If you already have content in /srv, it will be hidden by the new mount.
Back up your content before proceeding, or see recovery instructions below.
Adding space as a second volume
The additional space can be added to the instance as a separate logical volume. The easiest way to do this is by enabling the
After the Puppet run completes you should see a new volume mounted at
Moving old /srv data to new volume
If you only realized that you need more space after you have put things in the /srv directory of the root partition, follow these basic steps to move that data to the new volume:
Resize root partition
See Help:Resize root partition for an explanation of how to attempt to resize the
|The above content has been placed in a collapsed box for improved usability.|
Communication and support
Support and administration of the WMCS resources is provided by the Wikimedia Foundation Cloud Services team and Wikimedia Movement volunteers. Please reach out with questions and join the conversation:
- Chat in real time in the IRC channel #wikimedia-cloud connect, the bridged Telegram group, or the bridged Mattermost channel
- Discuss via email after you subscribed to the cloud@ mailing list