You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

Help:Adding Disk Space to Cloud VPS instances

From Wikitech-static
Revision as of 19:12, 14 February 2020 by imported>SRodlund (→‎Adding space as a second volume)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

This page explains how to add additional disk space to your Cloud VPS instance.

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 / volume.

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 role::labs::lvm::srv Puppet role.


If you have Horizon puppet set to 'yaml mode' (the default):

  1. go to https://horizon.wikimedia.org/project/ ;
  2. set "your project" in the project filter;
  3. find the instance you want to change the in the table below that;
  4. click on the Puppet Configuration tab to get to the Puppet management screen for that instance;
  5. Add a new line with "role::labs::lvm::srv" to the "Puppet Classes" field
  6. wait for the Puppet job to run, OR connect to the instance and run sudo puppet agent --test --verbose.


If you have Horizon puppet set to 'guided mode':

  1. go to https://horizon.wikimedia.org/project/ ;
  2. set "your project" in the project filter;
  3. find the instance you want to change the in the table below that;
  4. click on the Puppet Configuration tab to get to the Puppet management screen for that instance;
  5. in the row for role::labs::lvm::srv, click on the Apply Class button;
  6. in the pop-up, click on the Apply;
  7. wait for the Puppet job to run, OR connect to the instance and run sudo puppet agent --test --verbose.

After the Puppet run completes you should see a new volume mounted at /srv. The size of this volume will depend on the amount of remaining quota for your instance.

Mind the /srv. directory will be owned by root., and this will be enforced by puppet. /srv. is a directory for a collection of local content. Best practice is to create subdirectories for each individual service and give permissions to project members appropriately.

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:

  1. Add the new volume as shown above
  2. Run mount and make sure the volume is mounted. If it is not force another puppet run.
  3. Run sudo -s to get a root shell. This will make the next steps easier.
  4. puppet agent --disable 'Moving data from /srv to new volume'
  5. umount /srv
  6. mount /dev/mapper/vd-second--local--disk /mnt
  7. Copy data from /srv to /mnt with cd /srv; tar cf - . | (cd /mnt; tar xpvf -)
  8. Verify that /mnt now has the expected data.
  9. Remove old data from /srv with cd /srv; rm -rf *
  10. cd; umount /mnt
  11. mount /dev/mapper/vd-second--local--disk /srv
  12. Verify that mount worked with mount and by examining /srv
  13. puppet agent --enable
  14. puppet agent --test --verbose to make sure things stay as expected

Resize root partition

See Help:Resize root partition for an explanation of how to attempt to resize the / volume for an existing instance.

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:

Discuss and receive general support
Receive mail announcements about critical changes
Subscribe to the cloud-announce@ mailing list (all messages are also mirrored to the cloud@ list)
Track work tasks and report bugs
Use the Phabricator workboard #Cloud-Services for bug reports and feature requests about the Cloud VPS infrastructure itself
Learn about major near-term plans
Read the News wiki page
Read news and stories about Wikimedia Cloud Services
Read the Cloud Services Blog (for the broader Wikimedia movement, see the Wikimedia Technical Blog)