Bug 1505465

Summary: openstack server create can't parse --block-device option source=blank,dest=volume
Product: Red Hat OpenStack Reporter: jliberma <jliberma>
Component: python-openstackclientAssignee: Julie Pichon <jpichon>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Shai Revivo <srevivo>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 10.0 (Newton)CC: apevec, beth.white, jliberma, lhh, mbooth, sbauza, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-22 15:54:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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