Validate inputs when creating a baymodel

Bug #1412181 reported by hongbin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Medium
Unassigned

Bug Description

Magnum should not create a baymodel if the given image, flavor, keypair, and/or external network id is invalid. For example, the command below should not pass.

$ magnum baymodel-create --name testbaymodel --image-id invalidimage \
> --keypair-id=invalidkey \
> --external-network-id $(uuidgen) \
> --dns-nameserver 8.8.8.8 --flavor-id invalidflavor
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| apiserver_port | None |
| uuid | 37230ef5-ce3a-4414-88da-aaa8a80655b1 |
| external_network_id | 5b5da68c-1dcb-4115-ac93-cd58a2aaf6f4 |
| created_at | 2015-01-18T15:43:56.688587+00:00 |
| updated_at | None |
| image_id | invalidimage |
| keypair_id | invalidkey |
| flavor_id | invalidflavor |
| dns_nameserver | 8.8.8.8 |
| name | testbaymodel |
+---------------------+--------------------------------------+

hongbin (hongbin034)
summary: - Valid input when creating a baymodel
+ Validate input when creating a baymodel
summary: - Validate input when creating a baymodel
+ Validate inputs when creating a baymodel
Revision history for this message
Steven Dake (sdake) wrote :

The downside of validating on baymodel-create, is that later a user could come along and delete the networks, keypairs, flavors, or image, resulting in a baymodel that is still invalid.

Perhaps what is needed is a baymodel-validate ReST api call, which gets called automatically as part of the baymodel-create functionality, but is also callable later if the user runs into trouble running their baymodel.

I agree the current state of things makes debugging difficult and requires looking at the heat orchestration results, which most users may not be comfortable with.

Changed in magnum:
importance: Undecided → Medium
status: New → Confirmed
Changed in magnum:
assignee: nobody → Madhuri Kumari (madhuri-rai07)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/180158
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=ccb410f22384d750c74bd115bf0e8ac6fedbdec9
Submitter: Jenkins
Branch: master

commit ccb410f22384d750c74bd115bf0e8ac6fedbdec9
Author: Tom Cammann <email address hidden>
Date: Tue May 5 14:45:30 2015 +0100

    Improve validation on baymodel api calls

    - Don't allow empty strings and validate strings are not longer than 255
      chars were appropriate.
    - Min/Max value for api port
    - Docker volume size min size of 1
    - DNS server address must be an IPv4

    Change-Id: I2c26b758b908f03e60293c68dedf43eb90c3cad2
    Partial-Bug: 1412181

wangqun (bjwqun)
Changed in magnum:
status: Confirmed → Invalid
status: Invalid → Confirmed
Adrian Otto (aotto)
Changed in magnum:
milestone: none → mitaka-1
Changed in magnum:
assignee: Madhuri Kumari (madhuri-rai07) → nobody
rajiv (rajiv-kumar)
Changed in magnum:
assignee: nobody → rajiv (rajiv-kumar)
rajiv (rajiv-kumar)
Changed in magnum:
assignee: rajiv (rajiv-kumar) → nobody
Revision history for this message
yatin (yatinkarel) wrote :

It's seems fixed as parameters are validated using attr_validator.py in baymodel, please confirm and close this,

Revision history for this message
Stephen Watson (stephen-watson) wrote :

Confirmed we use attr_validator to validate input for PATCH and POST requests in baymodel. GET and DELETE don't use the same attr_validator script but validate otherwise.

Changed in magnum:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.