File: tutorial.rst

package info (click to toggle)
python-os-brick 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,140 kB
  • ctags: 1,319
  • sloc: python: 10,746; sh: 31; makefile: 26
file content (36 lines) | stat: -rw-r--r-- 1,122 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Tutorial
========

This tutorial is intended as an introduction to working with
**os-brick**.

Prerequisites
-------------
Before we start, make sure that you have the **os-brick** distribution
:doc:`installed <installation>`. In the Python shell, the following
should run without raising an exception:

.. code-block:: bash

  >>> import os_brick

Fetch all of the initiator information from the host
----------------------------------------------------
An example of how to collect the initiator information that is needed
to export a volume to this host.

.. code-block:: python

 from os_brick.initiator import connector

 # what helper do you want to use to get root access?
 root_helper = "sudo"
 # The ip address of the host you are running on
 my_ip = "192.168.1.1"
 # Do you want to support multipath connections?
 multipath = True
 # Do you want to enforce that multipath daemon is running?
 enforce_multipath = False
 initiator = connector.get_connector_properties(root_helper, my_ip,
                                                multipath,
                                                enforce_multipath)