Help:Adding Disk Space to Cloud VPS instances

Overview

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.

 

Quick Start

To add storage to a cloud-vps instance under /extrastorage:

  1. Create a volume in the Horizon Volumes interface with the 'Create Volume' button. Set name, size, and description. Leave the other settings as defaults.
  2. Attach that volume to your instance using the 'Manage Attachements' action in Horizon.
  3. On the VM, run sudo wmcs-prepare-cinder-volume.
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.

Useful Commands

wmcs-prepare-cinder-volume

The custom 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

The 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 vd<something>.

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 resize2fs:

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.

Storage Quotas

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)

Communication and support

We communicate and provide support through several primary channels. Please reach out with questions and to join the conversation.

Communicate with us
Connect Best for
Phabricator Workboard #Cloud-Services Task tracking and bug reporting
IRC Channel #wikimedia-cloud connect
Telegram bridge
mattermost bridge
General discussion and support
Mailing List cloud@ Information about ongoing initiatives, general discussion and support
Announcement emails cloud-announce@ Information about critical changes (all messages mirrored to cloud@)
News wiki page News Information about major near-term plans
Cloud Services Blog Clouds & Unicorns Learning more details about some of our work
Wikimedia Technical Blog techblog.wikimedia.org News and stories from the Wikimedia technical movement