File: cinder_volume_supporting.rst

package info (click to toggle)
murano 1%3A6.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,644 kB
  • sloc: python: 34,127; sh: 717; pascal: 269; makefile: 83
file content (152 lines) | stat: -rw-r--r-- 4,262 bytes parent folder | download | duplicates (3)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
.. _cinder_volume_supporting:

Cinder volume support
~~~~~~~~~~~~~~~~~~~~~

Cinder volume is a block storage service for OpenStack, which represents a
detachable device, similar to a USB hard drive. You can attach a volume to
only one instance. In murano, it is possible to work with Cinder volumes
in several ways:

* Attaching Cinder volumes to murano instance
* Booting from Cinder volume

Below both ways are considered with ApacheHttpServer application as an
example.

For more information about Cinder volumes, see
`Manage Cinder volumes
<http://docs.openstack.org/user-guide/common/cli_manage_volumes.html>`_.

Attaching Cinder volumes
------------------------

Several volumes can be attached to the murano instance. Consider an example
that shows how to attach a created volume to the instance (next, in the
*Booting from Cinder volume* section, we are going to boot from a volume
created by us).

**Example**

#. In the OpenStack dashboard, go to :guilabel:`Volumes` to create a volume.

#. Modify the ``ui.yaml`` file:

.. code-block:: yaml

    ....

    Application:
      ....
      instance:
        ....
        volumes:
          $.volumeConfiguration.volumePath:
            ?:
              type: io.murano.resources.ExistingCinderVolume
            openstackId: $.volumeConfiguration.volumeID

     ....

An existing Cinder volume can be initialized with its ``openstackId`` and can
be attached with its ``volumePath``. These parameters come here from
modified ``Forms`` section of the ``ui.yaml`` file:

.. code-block:: yaml

    ....

    Forms:
      - appConfiguration:
          ....
      - instanceConfiguration:
          ....
      - volumeConfiguration:
          fields:
            - name: volumeID
              type: string
              label: Existing volume ID
              description: Put in existing volume openstackID
              required: true
            - name: volumePath
              type: string
              label: Path
              description: Put in volume path to be mounted
              required: true

Therefore, create a ZIP archive of the built package and upload it to murano.
Attach created application to the environment. Enter its openstackId (which
can be found in OpenStack dashboard) and path for mounting. For example, you
can fill the latter with ``/dev/vdb`` value.

After the application is deployed, verify that the volume is attached to the
instance in the OpenStack dashboard :guilabel:`Volumes` tab. Alternatively,
see the topology of the ``Heat Stack``.


Booting from Cinder volume
--------------------------

You can create a volume from an existing image. The example below shows how to
create a volume from an image and use the volume to boot an instance.

**Example**

It is possible to create a volume through the Heat template, instead of
the OpenStack dashboard. For this, modify the ``ui.yaml`` file:

.. code-block:: yaml

    ....

    Templates:
      customJoinNet:
        ....
      bootVolumes:
        - volume:
            ?:
              type: io.murano.resources.CinderVolume
            size: $.instanceConfiguration.volSize
            sourceImage: $.instanceConfiguration.osImage
          bootIndex: 0
          deviceName: vda
          deviceType: disk
    ....

    Application:
      ....
      instance:
        ....
        blockDevices: $bootVolumes

    ....

The example above shows that the ``Templates`` section now has a
``bootVolumes`` field, which is stored in the changed ``Application``
section.
Pay attention that ``image`` property should be deleted from
``Application`` to avoid defining both image and volume to boot.
The ``size`` and ``sourceImage`` properties come in ``Templates`` from the
changed ``Forms`` section of the ``ui.yaml`` file:

.. code-block:: yaml

    ....

    Forms:
      - appConfiguration:
          ....

      - instanceConfiguration:
          fields:
            ....
            - name: volSize
              type: integer
              label: Size of volume
              required: true
              description: >-
                Specify volume size which is going to be created from image
            ....

After sending this package to murano you can boot your instance from the
volume by chosen image.