summaryrefslogtreecommitdiff
path: root/doc/source/cli/command-objects/volume.rst
blob: ac414110a07f81080eafa271009aae03b4fbbe12 (plain)
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
======
volume
======

Block Storage v1, v2

volume create
-------------

Create new volume

.. program:: volume create
.. code:: bash

    openstack volume create
        [--size <size>]
        [--type <volume-type>]
        [--image <image> | --snapshot <snapshot> | --source <volume> ]
        [--description <description>]
        [--availability-zone <availability-zone>]
        [--consistency-group <consistency-group>]
        [--property <key=value> [...] ]
        [--hint <key=value> [...] ]
        [--bootable | --non-bootable]
        [--read-only | --read-write]
        <name>

.. option:: --size <size>

    Volume size in GB
    (Required unless --snapshot or --source is specified)

.. option:: --type <volume-type>

    Set the type of volume

    Select ``<volume-type>`` from the available types as shown
    by ``volume type list``.

.. option:: --image <image>

    Use ``<image>`` as source of volume (name or ID)

    This is commonly used to create a boot volume for a server.

.. option:: --snapshot <snapshot>

    Use ``<snapshot>`` as source of volume (name or ID)

.. option:: --source <volume>

    Volume to clone (name or ID)

.. option:: --description <description>

    Volume description

.. option:: --availability-zone <availability-zone>

    Create volume in ``<availability-zone>``

.. option:: --consistency-group <consistency-group>

    Consistency group where the new volume belongs to

.. option:: --property <key=value>

    Set a property on this volume (repeat option to set multiple properties)

.. option:: --hint <key=value>

    Arbitrary scheduler hint key-value pairs to help boot an instance
    (repeat option to set multiple hints)

.. option:: --bootable

    Mark volume as bootable

.. option:: --non-bootable

    Mark volume as non-bootable (default)

.. option:: --read-only

    Set volume to read-only access mode

.. option:: --read-write

    Set volume to read-write access mode (default)

.. _volume_create-name:
.. describe:: <name>

    Volume name

volume delete
-------------

Delete volume(s)

.. program:: volume delete
.. code:: bash

    openstack volume delete
        [--force | --purge]
        <volume> [<volume> ...]

.. option:: --force

    Attempt forced removal of volume(s), regardless of state (defaults to False)

.. option:: --purge

    Remove any snapshots along with volume(s) (defaults to False)

    *Volume version 2 only*

.. _volume_delete-volume:
.. describe:: <volume>

    Volume(s) to delete (name or ID)

volume list
-----------

List volumes

.. program:: volume list
.. code:: bash

    openstack volume list
        [--project <project> [--project-domain <project-domain>]]
        [--user <user> [--user-domain <user-domain>]]
        [--name <name>]
        [--status <status>]
        [--all-projects]
        [--long]
        [--limit <num-volumes>]
        [--marker <volume>]

.. option:: --project <project>

    Filter results by ``<project>`` (name or ID) (admin only)

    *Volume version 2 only*

.. option:: --project-domain <project-domain>

    Domain the project belongs to (name or ID).

    This can be used in case collisions between project names exist.

    *Volume version 2 only*

.. option:: --user <user>

    Filter results by ``<user>`` (name or ID) (admin only)

    *Volume version 2 only*

.. option:: --user-domain <user-domain>

    Domain the user belongs to (name or ID).

    This can be used in case collisions between user names exist.

    *Volume version 2 only*

.. option:: --name <name>

    Filter results by volume name

.. option:: --status <status>

    Filter results by status

.. option:: --all-projects

    Include all projects (admin only)

.. option:: --long

    List additional fields in output

.. option:: --limit <num-volumes>

    Maximum number of volumes to display

.. option:: --marker <volume>

    The last volume ID of the previous page

    *Volume version 2 only*

volume migrate
--------------

Migrate volume to a new host

.. program:: volume migrate
.. code:: bash

    openstack volume migrate
        --host <host>
        [--force-host-copy]
        [--lock-volume]
        <volume>

.. option:: --host <host>

    Destination host (takes the form: host@backend-name#pool) (required)

.. option:: --force-host-copy

    Enable generic host-based force-migration,
    which bypasses driver optimizations

.. option:: --lock-volume

    If specified, the volume state will be locked and will not allow
    a migration to be aborted (possibly by another operation)

    *Volume version 2 only*

.. _volume_migrate-volume:
.. describe:: <volume>

    Volume to migrate (name or ID)

volume set
----------

Set volume properties

.. program:: volume set
.. code:: bash

    openstack volume set
        [--name <name>]
        [--size <size>]
        [--description <description>]
        [--no-property]
        [--property <key=value> [...] ]
        [--image-property <key=value> [...] ]
        [--state <state>]
        [--attached | --detached ]
        [--type <volume-type>]
        [--retype-policy <retype-policy>]
        [--bootable | --non-bootable]
        [--read-only | --read-write]
        <volume>

.. option:: --name <name>

    New volume name

.. option:: --size <size>

    Extend volume size in GB

.. option:: --description <description>

    New volume description

.. option:: --no-property

    Remove all properties from :ref:`\<volume\> <volume_set-volume>`
    (specify both :option:`--no-property` and :option:`--property` to
    remove the current properties before setting new properties.)

.. option:: --property <key=value>

    Set a property on this volume (repeat option to set multiple properties)

.. option:: --type <volume-type>

    New volume type (name or ID)

    *Volume version 2 only*

.. option:: --retype-policy <retype-policy>

    Migration policy while re-typing volume
    ("never" or "on-demand", default is "never" )
    (available only when :option:`--type` option is specified)

    *Volume version 2 only*

.. option:: --bootable

    Mark volume as bootable

.. option:: --non-bootable

    Mark volume as non-bootable

.. option:: --read-only

    Set volume to read-only access mode

.. option:: --read-write

    Set volume to read-write access mode

.. option:: --image-property <key=value>

    Set an image property on this volume
    (repeat option to set multiple image properties)

    Image properties are copied along with the image when creating a volume
    using ``--image``.  Note that these properties are immutable on the image
    itself, this option updates the copy attached to this volume.

    *Volume version 2 only*

.. option:: --state <state>

    New volume state
    ("available", "error", "creating", "deleting", "in-use",
    "attaching", "detaching", "error_deleting" or "maintenance") (admin only)
    (This option simply changes the state of the volume in the database with
    no regard to actual status, exercise caution when using)

    *Volume version 2 only*

.. option:: --attached

    Set volume attachment status to "attached" (admin only)
    (This option simply changes the state of the volume in the database with
    no regard to actual status, exercise caution when using)

    *Volume version 2 only*

.. option:: --deattach

    Set volume attachment status to "detached" (admin only)
    (This option simply changes the state of the volume in the database with
    no regard to actual status, exercise caution when using)

    *Volume version 2 only*

.. _volume_set-volume:
.. describe:: <volume>

    Volume to modify (name or ID)

volume show
-----------

Show volume details

.. program:: volume show
.. code:: bash

    openstack volume show
        <volume>

.. _volume_show-volume:
.. describe:: <volume>

    Volume to display (name or ID)

volume unset
------------

Unset volume properties

.. program:: volume unset
.. code:: bash

    openstack volume unset
        [--property <key>]
        [--image-property <key>]
        <volume>

.. option:: --property <key>

    Remove a property from volume (repeat option to remove multiple properties)

.. option:: --image-property <key>

    Remove an image property from volume
    (repeat option to remove multiple image properties)

    *Volume version 2 only*

.. _volume_unset-volume:
.. describe:: <volume>

    Volume to modify (name or ID)