Skip to content

Commit 8cf19cd

Browse files
committed
Initial commit
0 parents  commit 8cf19cd

20 files changed

+1526
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
venv

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

README.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Template of OpenStack administration guide
2+
==========================================
3+
4+
Customise the guide
5+
-------------------
6+
7+
* Fork this repository
8+
* Customise source/vars.rst
9+
* Customise source/data/deployment.yml
10+
11+
Build the guide
12+
---------------
13+
14+
Prepare your build environment:
15+
16+
.. code-block:: console
17+
18+
python3 -m venv venv
19+
source venv/bin/activate
20+
pip install -r requirements.txt
21+
22+
Then use one of the following build commands:
23+
24+
.. code-block:: console
25+
26+
make html
27+
make singlehtml
28+
29+
Run ``make`` to see all possible builds. PDF builds will require extra packages
30+
to be installed.

make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
PyYAML
2+
Sphinx
3+
Sphinx-Substitution-Extensions

source/_static/openrc.png

32.5 KB
Loading

source/ceph_ansible.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Making a Ceph-Ansible Checkout
2+
------------------------------
3+
4+
Invoking Ceph-Ansible
5+
---------------------

source/ceph_storage.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.. include:: vars.rst
2+
3+
============
4+
Ceph Storage
5+
============
6+
7+
.. ifconfig:: deployment['ceph']
8+
9+
The |project_name| deployment uses Ceph as a storage backend.
10+
11+
.. ifconfig:: deployment['ceph_managed']
12+
13+
The Ceph deployment is managed by StackHPC Ltd.
14+
15+
.. ifconfig:: not deployment['ceph_managed']
16+
17+
The Ceph deployment is not managed by StackHPC Ltd.
18+
19+
.. ifconfig:: deployment['ceph_ansible']
20+
21+
Ceph Ansible
22+
============
23+
24+
.. include:: ceph_ansible.rst
25+
26+
Ceph Troubleshooting
27+
====================
28+
29+
.. include:: ceph_troubleshooting.rst

source/ceph_troubleshooting.rst

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Inspecting a Ceph Block Device for a VM
2+
---------------------------------------
3+
4+
To find out what block devices are attached to a VM, go to the hypervisor that
5+
it is running on (an admin-level user can see this from ``openstack server
6+
show``).
7+
8+
On this hypervisor, enter the libvirt container:
9+
10+
.. code-block:: console
11+
:substitutions:
12+
13+
|hypervisor_hostname|# docker exec -it nova_libvirt /bin/bash
14+
15+
Find the VM name using libvirt:
16+
17+
.. code-block:: console
18+
:substitutions:
19+
20+
(nova-libvirt)[root@|hypervisor_hostname| /]# virsh list
21+
Id Name State
22+
------------------------------------
23+
1 instance-00000001 running
24+
25+
Now inspect the properties of the VM using ``virsh dumpxml``:
26+
27+
.. code-block:: console
28+
:substitutions:
29+
30+
(nova-libvirt)[root@|hypervisor_hostname| /]# virsh dumpxml instance-00000001 | grep rbd
31+
<source protocol='rbd' name='|nova_rbd_pool|/51206278-e797-4153-b720-8255381228da_disk'>
32+
33+
On a Ceph node, the RBD pool can be inspected and the volume extracted as a RAW
34+
block image:
35+
36+
.. code-block:: console
37+
:substitutions:
38+
39+
ceph# rbd ls |nova_rbd_pool|
40+
ceph# rbd export |nova_rbd_pool|/51206278-e797-4153-b720-8255381228da_disk blob.raw
41+
42+
The raw block device (blob.raw above) can be mounted using the loopback device.
43+
44+
Inspecting a QCOW Image using LibGuestFS
45+
----------------------------------------
46+
47+
The virtual machine's root image can be inspected by installing
48+
libguestfs-tools and using the guestfish command:
49+
50+
.. code-block:: console
51+
52+
ceph# export LIBGUESTFS_BACKEND=direct
53+
ceph# guestfish -a blob.qcow
54+
><fs> run
55+
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
56+
><fs> list-filesystems
57+
/dev/sda1: ext4
58+
><fs> mount /dev/sda1 /
59+
><fs> ls /
60+
bin
61+
boot
62+
dev
63+
etc
64+
home
65+
lib
66+
lib64
67+
lost+found
68+
media
69+
mnt
70+
opt
71+
proc
72+
root
73+
run
74+
sbin
75+
srv
76+
sys
77+
tmp
78+
usr
79+
var
80+
><fs> quit

source/conf.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'OpenStack Administration Guide'
21+
copyright = '2020, StackHPC Ltd'
22+
author = 'StackHPC Ltd'
23+
24+
25+
# -- General configuration ---------------------------------------------------
26+
27+
# Add any Sphinx extension module names here, as strings. They can be
28+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29+
# ones.
30+
extensions = [
31+
'sphinx.ext.ifconfig',
32+
'sphinx-prompt',
33+
'sphinx_substitution_extensions',
34+
]
35+
36+
# Add any paths that contain templates here, relative to this directory.
37+
templates_path = ['_templates']
38+
39+
# List of patterns, relative to source directory, that match files and
40+
# directories to ignore when looking for source files.
41+
# This pattern also affects html_static_path and html_extra_path.
42+
exclude_patterns = []
43+
44+
45+
# -- Options for HTML output -------------------------------------------------
46+
47+
# The theme to use for HTML and HTML Help pages. See the documentation for
48+
# a list of builtin themes.
49+
#
50+
html_theme = 'alabaster'
51+
52+
# Add any paths that contain custom static files (such as style sheets) here,
53+
# relative to this directory. They are copied after the builtin static files,
54+
# so a file named "default.css" will overwrite the builtin "default.css".
55+
html_static_path = ['_static']
56+
57+
# -- Load deployment configuration from YAML ---------------------------------
58+
59+
import yaml
60+
61+
with open('data/deployment.yml', 'r') as f:
62+
deployment = yaml.safe_load(f)
63+
64+
def setup(app):
65+
app.add_config_value('deployment', deployment, 'env')

0 commit comments

Comments
 (0)