User Tools

Site Tools


services:vpshosts

This is an old revision of the document!


VPSHOSTS

Summary

VPSHOSTs are Miras we took out of the testpool to use as hypervisors for testing VMs.

See the vps_hosts section of the ansible inventory to see which miras are used as VPSHOSTs. Or query the lock database teuthology-lock --brief -a | grep VPS.

VPSHOSTs are managed using the vmhost ansible role in ceph-cm-ansible.

Virtual Machines

Each VPSHOST is home to 8 4 virtual machines. Each VM has its own JBOD disk assigned to it with 4GB RAM and 1 vCPU.

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. See http://tracker.ceph.com/issues/15052

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.

apt-get install xfsprogs

# Determine the first and last VPS number by reading the VPSHOST's description in the lock db
# In this example, the VPSes that live on the VPSHOST are vpm177 thru vpm184

for sys in vpm{049,051,053,055}; do mkdir -p /srv/libvirtpool/$sys; done
for disk in sd{b..d}; do mkfs -t xfs -f /dev/$disk; done

# num should be second VPM
num=51; for disk in sd{b..d}; do mount /dev/$disk /srv/libvirtpool/vpm0$num; let num=num+2; done
# OR if VPM$num is < 100,
num=101; for disk in sd{b..d}; do mount /dev/$disk /srv/libvirtpool/vpm$num; let num=num+2; done

num=51; for disk in sd{b..d}; do echo -e "UUID=$(blkid -s UUID -o value /dev/$disk)\t/srv/libvirtpool/vpm0$num\txfs\tdefaults,noatime,nodiratime,nobarrier,inode64,logbufs=8,logbsize=256k,largeio\t0\t0"; let num=num+2; done >> /etc/fstab
# OR if VPM$num is < 100,
num=101; for disk in sd{b..d}; do echo -e "UUID=$(blkid -s UUID -o value /dev/$disk)\t/srv/libvirtpool/vpm$num\txfs\tdefaults,noatime,nodiratime,nobarrier,inode64,logbufs=8,logbsize=256k,largeio\t0\t0"; let num=num+2; done >> /etc/fstab

# Verify fstab, then
mount -a

# On your workstation,
ansible-playbook vmhost.yml --limit="mira###.front.sepia.ceph.com"

# Run this again to fix libvirtpool permissions
ansible-playbook vmhost.yml --limit="mira###.front.sepia.ceph.com"

# Lock the first VPM on the host to download the disk image
tl --lock ubuntu@$firstvpm

# Copy the disk image to the other libvirtpools
for dir in $(ls /srv/libvirtpool/ | tail -n 7); do cp /srv/libvirtpool/$(ls /srv/libvirtpool/ | head -n 1)/ubuntu* /srv/libvirtpool/$dir/; done

for pool in $(ls /srv/libvirtpool/); do virsh pool-refresh $pool; done

# Lock then unlock all the VPSes to verify everything looks good
for sys in vpm{051,053,055,057}; do tl --lock ubuntu@$sys; done
for sys in vpm{051,053,055,057}; do tl --unlock ubuntu@$sys; done

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 /etc/fstab

# Physically replace the disk

# Create a new filesystem on the new disk
mkfs -t xfs /dev/$new_disk

# Mount the new disk partition to the VM's libvirtpool mount
mount /dev/$new_disk /srv/libvirtpool/vpm###

# Obtain the new UUID
lsblk -o name,uuid,mountpoint

# Replace the old UUID in /etc/fstab

# Mark the VM back up
teuthology-lock --update --status up vpm###
services/vpshosts.1487794369.txt.gz · Last modified: by dgalloway