Bug 1505465 - openstack server create can't parse --block-device option source=blank,dest=volume
Summary: openstack server create can't parse --block-device option source=blank,dest=v...
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-openstackclient
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Julie Pichon
QA Contact: Shai Revivo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-23 16:00 UTC by jliberma@redhat.com
Modified: 2023-09-14 04:10 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-22 15:54:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description jliberma@redhat.com 2017-10-23 16:00:26 UTC
Description of problem:

Creating an instance using openstack server create fails when creating a blank Cinder volume:

  nova boot \
  --nic net-id=$netid1 \
  --flavor m1.master \
  --image rhel-server-7.4 \
  --key-name ocpkey \
  --security-groups mastersg,nodesg \
  --user-data=/home/stack/user-data/$node.yaml \
  --block-device source=blank,dest=volume,device=vdb,size=15,shutdown=preserve \
  servername


Error:

No volume with a name or ID of 'blank,dest=volume,device=vdb,size=15,shutdown=preserve' exists.

This works:

  nova boot \
  --nic net-id=$netid1 \
  --flavor m1.master \
  --image rhel-server-7.4 \
  --key-name ocpkey \
  --security-groups mastersg \
  --block-device source=blank,dest=volume,device=vdb,size=15,shutdown=preserve \
  servername

This fails:

  opensatck server create \
  --nic net-id=$netid1 \
  --flavor m1.master \
  --image rhel-server-7.4 \
  --key-name ocpkey \
  --security-group mastersg \
  --block-device source=blank,dest=volume,device=vdb,size=15,shutdown=preserve \
  servername

Version-Release number of selected component (if applicable):

python-openstackclient-3.2.1-2.el7ost.noarch

Comment 3 Julie Pichon 2018-02-15 17:08:45 UTC
Moving this over to the Compute DFG as it's about server-related commands. From what I can tell from a quick look at the help, --block-device doesn't exist as an option in OSC. There is a --volume and a --block-device-mapping options though both appear to require a pre-existing volume, not sure how/if this can be done in the one step.

Comment 5 Sylvain Bauza 2018-03-09 15:15:19 UTC
Disclaimer : I'm not an OSC expert, but I can read its code.

From what I see, OSC doesn't have the same arguments for BDMs.

If you want to ask for a specific BDM to be attached to an instance, the help command tells you :

        parser.add_argument(
            '--block-device-mapping',
            metavar='<dev-name=mapping>',
            action=parseractions.KeyValueAction,
            default={},
            # NOTE(RuiChen): Add '\n' at the end of line to put each item in
            #                the separated line, avoid the help message looks
            #                messy, see _SmartHelpFormatter in cliff.
            help=_('Create a block device on the server.\n'
                   'Block device mapping in the format\n'
                   '<dev-name>=<id>:<type>:<size(GB)>:<delete-on-terminate>\n'
                   '<dev-name>: block device name, like: vdb, xvdc '
                   '(required)\n'
                   '<id>: UUID of the volume or snapshot (required)\n'
                   '<type>: volume or snapshot; default: volume (optional)\n'
                   '<size(GB)>: volume size if create from snapshot '
                   '(optional)\n'
                   '<delete-on-terminate>: true or false; default: false '
                   '(optional)\n'
'(optional extension)'),

so you really need to use --block-device-mapping '<dev-name>=<id>:<type>:<size(GB)>:<delete-on-terminate>'

Could you please test that syntax and tell us if that works ? 
Thanks.

Comment 6 Matthew Booth 2018-03-22 15:54:09 UTC
I have closed this bug as it has been waiting for more info for at least 2 weeks. We only do this to ensure that we don't accumulate stale bugs which can't be addressed. If you are able to provide the requested information, please feel free to re-open this bug.

Comment 7 Red Hat Bugzilla 2023-09-14 04:10:43 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.