services:vpshosts
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| services:vpshosts [2016/07/05 21:47] – created dgalloway | services:vpshosts [2017/08/15 22:46] (current) – djgalloway | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| VPSHOSTs are [[hardware: | VPSHOSTs are [[hardware: | ||
| - | See the [[https:// | + | See the [[https:// |
| + | |||
| + | VPSHOSTs are managed using the [[https:// | ||
| + | |||
| + | ===== Virtual Machines ===== | ||
| + | Each VPSHOST is home to < | ||
| + | |||
| + | In June 2016, we marked down all the even-numbered VPSes and made a change to teuthology which creates the VMs with 4GB RAM as 2GB per VM wasn't meeting the needs. | ||
| + | |||
| + | ===== Common Tasks ===== | ||
| + | ==== Updating users so new users can downburst VMs ==== | ||
| + | < | ||
| + | ansible-playbook common.yml --limit vps_hosts | ||
| + | </ | ||
| + | |||
| + | ==== Setting up a VPSHOST from scratch ==== | ||
| + | **NOTE:** This has been adapted to be applicable for 4 VPSes and disks per host. | ||
| + | |||
| + | If setting up a host as a new or replacement VPSHOST, be sure to update your libvirt config. | ||
| + | |||
| + | If you install the machine using a '' | ||
| + | |||
| + | < | ||
| + | apt-get install xfsprogs vim | ||
| + | |||
| + | # Determine the first and last VPS number by reading the VPSHOST' | ||
| + | # In this example, the VPSes that live on the VPSHOST are vpm177 thru vpm184 | ||
| + | |||
| + | for sys in vpm{049, | ||
| + | for disk in sd{b..d}; do mkfs -t xfs -f /dev/$disk; done | ||
| + | |||
| + | ## Not really needed if next task and `mount -s` succeeds | ||
| + | # $num should be second VPM | ||
| + | num=51; for disk in sd{b..d}; do mount /dev/$disk / | ||
| + | # OR if VPM$num is >= 100, | ||
| + | num=101; for disk in sd{b..d}; do mount /dev/$disk / | ||
| + | |||
| + | # $num should be second VPM | ||
| + | num=51; for disk in sd{b..d}; do echo -e " | ||
| + | # OR if VPM$num is >= 100, | ||
| + | num=101; for disk in sd{b..d}; do echo -e " | ||
| + | |||
| + | # Verify fstab, then | ||
| + | mount -a | ||
| + | |||
| + | # On your workstation, | ||
| + | ansible-playbook vmhost.yml --limit=" | ||
| + | |||
| + | # Run this again to fix libvirtpool permissions | ||
| + | ansible-playbook vmhost.yml --limit=" | ||
| + | |||
| + | # Make sure the first VPM is down | ||
| + | tl --update --status down vpm049 | ||
| + | |||
| + | # Lock the first VPM on the host to download disk images | ||
| + | tl --lock --os-type ubuntu --os-version 14.04 ubuntu@vpm049 | ||
| + | tl --unlock ubuntu@vpm049 | ||
| + | tl --lock --os-type ubuntu --os-version 16.04 ubuntu@vpm049 | ||
| + | tl --unlock ubuntu@vpm049 | ||
| + | tl --lock --os-type centos --os-version 7.3 ubuntu@vpm049 | ||
| + | tl --unlock ubuntu@vpm049 | ||
| + | |||
| + | # Copy the disk image to the other libvirtpools | ||
| + | for dir in $(ls / | ||
| + | |||
| + | for pool in $(ls / | ||
| + | |||
| + | # Lock then unlock all the VPSes to verify everything looks good | ||
| + | for sys in vpm{049, | ||
| + | for sys in vpm{049, | ||
| + | </ | ||
| + | |||
| + | ==== Replace bad VPSHOST disk ==== | ||
| + | < | ||
| + | # Mark the VM down | ||
| + | teuthology-lock --update --status down vpm### | ||
| + | |||
| + | # On the VPSHOST, | ||
| + | umount $bad_disk | ||
| + | # Comment out bad disk in / | ||
| + | |||
| + | # Physically replace the disk | ||
| + | |||
| + | # Create a new filesystem on the new disk | ||
| + | mkfs -t xfs / | ||
| + | |||
| + | # Mount the new disk partition to the VM's libvirtpool mount | ||
| + | mount / | ||
| + | |||
| + | # Obtain the new UUID | ||
| + | lsblk -o name, | ||
| + | |||
| + | # Replace the old UUID in / | ||
| + | |||
| + | # Mark the VM back up | ||
| + | teuthology-lock --update --status up vpm### | ||
| + | </ | ||
services/vpshosts.1467755272.txt.gz · Last modified: by dgalloway
