Make block-device-mapping more stable and clear

Bug #1667266 reported by Rui Chen on 2017-02-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
Rui Chen

Bug Description

There are some issues in "--block-device-mapping" options of "server create" commands.

1. ValueError is raised if input don't contain "=". Sometimes the whole "server create" command is very complex, it's difficult to find out root reason directly, like this:

(openstack) server create --image cirros-0.3.5-x86_64-disk --flavor m1.tiny --nic net-id=d73b6234-91ff-466e-8b5d-141aa9b48ac8 --block-device-mapping vdb0ac9844f-2122-47a4-9a1b-676c59cdd662 chenrui_vm
need more than 1 value to unpack
(openstack)

2. Don't support to add block device from snapshot, like: --block-device-mapping vdb=0c8ae9d8-cadc-4a23-8337-4254614d277e:snapshot:1, it's supported by novaclient, but not in osc.

(openstack) volume snapshot list
+--------------------------------------+--------------+-------------+-----------+------+
| ID | Name | Description | Status | Size |
+--------------------------------------+--------------+-------------+-----------+------+
| 0c8ae9d8-cadc-4a23-8337-4254614d277e | chenrui_snap | None | available | 1 |
+--------------------------------------+--------------+-------------+-----------+------+
(openstack) server create --image cirros-0.3.5-x86_64-disk --flavor m1.tiny --block-device-mapping vdb=0c8ae9d8-cadc-4a23-8337-4254614d277e:snapshot:1 chenrui_v
No volume with a name or ID of '0c8ae9d8-cadc-4a23-8337-4254614d277e' exists.
(openstack)

3. If input "vdb=", not add any mapping information, the server will be launched successfully, not raise error message to let use add volume/snapshot id, just ignore "--block-device-mapping" option

(openstack) server create --image cirros-0.3.5-x86_64-disk --flavor m1.tiny --nic net-id=d73b6234-91ff-466e-8b5d-141aa9b48ac8 --block-device-mapping vdb= chenrui_vm
...

4. The help message of "block-device-mapping" option is so simple, need to add some details about how to add <type>, <delete_on_terminate> contains.

  --block-device-mapping <dev-name=mapping>
                        Map block devices; map is
                        <id>:<type>:<size(GB)>:<delete_on_terminate> (optional
                        extension)

Rui Chen (kiwik-chenrui) on 2017-02-23
Changed in python-openstackclient:
assignee: nobody → Rui Chen (kiwik-chenrui)
Rui Chen (kiwik-chenrui) on 2017-02-24
description: updated

Fix proposed to branch: master
Review: https://review.openstack.org/438141

Changed in python-openstackclient:
status: New → In Progress

Reviewed: https://review.openstack.org/438141
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=7a7bb06377c96f7bfc2c371aa2ff726ee364a9db
Submitter: Jenkins
Branch: master

commit 7a7bb06377c96f7bfc2c371aa2ff726ee364a9db
Author: Rui Chen <email address hidden>
Date: Fri Feb 24 16:48:05 2017 +0800

    Make block-device-mapping more stable and clear

    The patch fix the following issues:

    1. ValueError is raised if input don't contain "=". Sometimes the whole
    "server create" command is very complex, it's difficult to find out root
    reason directly.
    2. Don't support to add block device from snapshot, like:
    --block-device-mapping
    vdb=0c8ae9d8-cadc-4a23-8337-4254614d277e:snapshot:1, it's supported by
    novaclient, but not in osc.
    3. If input "vdb=", not add any mapping information, the server will be
    launched successfully, not raise error message to let use add
    volume/snapshot id, just ignore "--block-device-mapping" option.
    4. The help message of "block-device-mapping" option is so simple, need
    to add some details about how to add <type>, <delete_on_terminate>
    contains.

    Change-Id: Ib7f7a654c3dc2a8272545f168b4c4ced230ce39e
    Depends-On: Ib37913891bbf7a31b570404c4668c490d5ac859b
    Closes-Bug: #1667266

Changed in python-openstackclient:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-openstackclient 3.12.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers