From c19da4c8a7ecd7196bc538f46ce96c3af7ff1c0f Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 24 Apr 2014 14:14:21 -0700 Subject: [PATCH] Move cinder docs into sysadmin section And reference them from hosts that use cinder volumes. Change-Id: I180f13a44d8e45209df8c6a16f275d987d05cbfe --- doc/source/gerrit.rst | 7 ++++ doc/source/static.rst | 75 +---------------------------------- doc/source/sysadmin.rst | 86 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 93 insertions(+), 75 deletions(-) diff --git a/doc/source/gerrit.rst b/doc/source/gerrit.rst index 9d0d2b2152..f7496b216f 100644 --- a/doc/source/gerrit.rst +++ b/doc/source/gerrit.rst @@ -41,6 +41,13 @@ Gerrit is installed and configured by Puppet, including specifying the exact Java WAR file that is used. See :ref:`sysadmin` for how Puppet is used to manage OpenStack infrastructure systems. +Cinder Volumes +-------------- + +The Gerrit installation at /home/gerrit2 is located on a Cinder +volume. See :ref:`cinder` for details on volume management. Note +that SSD volumes are used (and they have a mininum size of 100G). + Gerrit Configuration -------------------- diff --git a/doc/source/static.rst b/doc/source/static.rst index c41dd87dde..c48c5685c8 100644 --- a/doc/source/static.rst +++ b/doc/source/static.rst @@ -30,77 +30,4 @@ Each apache vhost has a section in the puppet manifest for the static host. Some of the vhosts hold large amounts of data; Cinder volumes and LVM are used to manage those. -Adding a New Device -=================== - -If the main volume group doesn't have enough space for what you want -to do, this is how you can add a new volume. - -Log into ci-puppetmaster.openstack.org and run:: - - . ~root/cinder-venv/bin/activate - . ~root/ci-launch/cinder.sh - - nova list - cinder list - -* Add a new cinder volume (substitute the next number in series for - NN):: - - cinder create --display-name "static.openstack.org/mainNN" 1024 - nova volume-attach auto - -* On static.openstack.org, create the partition table:: - - DEVICE=/dev/xvdX - sudo parted $DEVICE mklabel msdos mkpart primary 0% 100% set 1 lvm on - sudo pvcreate ${DEVICE}1 - -* It should show up in pvs:: - - $ sudo pvs - PV VG Fmt Attr PSize PFree - /dev/xvdX1 lvm2 a- 1024.00g 1024.00g - -* Add it to the main volume group:: - - sudo vgextend main ${DEVICE}1 - -Creating a New Logical Volume -============================= - -Make sure there is enough space in the volume group:: - - $ sudo vgs - VG #PV #LV #SN Attr VSize VFree - main 4 2 0 wz--n- 2.00t 347.98g - -If not, see `Adding a New Device`_. - -Create the new logical volume and initialize the filesystem:: - - NAME=newvolumename - sudo lvcreate -L1500GB -n $NAME main - - sudo mkfs.ext4 -m 0 -j -L $NAME /dev/main/$NAME - sudo tune2fs -i 0 -c 0 /dev/main/$NAME - -Be sure to add it to ``/etc/fstab``. - -Expanding an Existing Logical Volume -==================================== - -Make sure there is enough space in the volume group:: - - $ sudo vgs - VG #PV #LV #SN Attr VSize VFree - main 4 2 0 wz--n- 2.00t 347.98g - -If not, see `Adding a New Device`_. - -The following example to increase the size of a volume by 100G is -untested; please confirm:: - - NAME=volumename - sudo lvextend -L+100G /dev/main/$NAME - sudo resize2fs /dev/main/$NAME +See :ref:`cinder` for details on volume management. diff --git a/doc/source/sysadmin.rst b/doc/source/sysadmin.rst index 91bf5b96ba..4798adb89e 100644 --- a/doc/source/sysadmin.rst +++ b/doc/source/sysadmin.rst @@ -266,10 +266,94 @@ Note if you created your working directory in a path that is not excluded by bup you will want to remove that directory when your work is done. /root/backup-restore-* is excluded so the path above is safe. -Launching new servers +Launching New Servers ===================== New servers are launched using the ``launch/launch-node.py`` tool from the git repository ``https://git.openstack.org/openstack-infra/config``. This tool is run from a checkout on the puppetmaster - please see :file:`launch/README` for detailed instructions. + +.. _cinder: + +Cinder Volume Management +======================== + +Adding a New Device +------------------- + +If the main volume group doesn't have enough space for what you want +to do, this is how you can add a new volume. + +Log into ci-puppetmaster.openstack.org and run:: + + . ~root/cinder-venv/bin/activate + . ~root/ci-launch/cinder.sh + + nova list + cinder list + +* Add a new 1024G cinder volume (substitute the hostname and the next number + in series for NN):: + + cinder create --display-name "HOSTNAME.openstack.org/mainNN" 1024 + nova volume-attach auto + +* or to add a 100G SSD volume:: + + cinder create --volume-type SSD --display-name "HOSTNAME.openstack.org/mainNN" 100 + nova volume-attach auto + +* Then, on the host, create the partition table:: + + DEVICE=/dev/xvdX + sudo parted $DEVICE mklabel msdos mkpart primary 0% 100% set 1 lvm on + sudo pvcreate ${DEVICE}1 + +* It should show up in pvs:: + + $ sudo pvs + PV VG Fmt Attr PSize PFree + /dev/xvdX1 lvm2 a- 1024.00g 1024.00g + +* Add it to the main volume group:: + + sudo vgextend main ${DEVICE}1 + +Creating a New Logical Volume +----------------------------- + +Make sure there is enough space in the volume group:: + + $ sudo vgs + VG #PV #LV #SN Attr VSize VFree + main 4 2 0 wz--n- 2.00t 347.98g + +If not, see `Adding a New Device`_. + +Create the new logical volume and initialize the filesystem:: + + NAME=newvolumename + sudo lvcreate -L1500GB -n $NAME main + + sudo mkfs.ext4 -m 0 -j -L $NAME /dev/main/$NAME + sudo tune2fs -i 0 -c 0 /dev/main/$NAME + +Be sure to add it to ``/etc/fstab``. + +Expanding an Existing Logical Volume +------------------------------------ + +Make sure there is enough space in the volume group:: + + $ sudo vgs + VG #PV #LV #SN Attr VSize VFree + main 4 2 0 wz--n- 2.00t 347.98g + +If not, see `Adding a New Device`_. + +The following example increases the size of a volume by 100G:: + + NAME=volumename + sudo lvextend -L+100G /dev/main/$NAME + sudo resize2fs /dev/main/$NAME