Bug 858030

Summary: Provider HWP with 0 storage should be valid
Product: [Retired] CloudForms Cloud Engine Reporter: Matt Wagner <matt.wagner>
Component: aeolus-conductorAssignee: Angus Thomas <athomas>
Status: CLOSED EOL QA Contact: Rehana <aeolus-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.1.0CC: athomas, morazi
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 18:38:49 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 Matt Wagner 2012-09-17 20:07:21 UTC
Description of problem:
Conductor considers a provider hardware profile with 0GB of storage be invalid, and will refuse to save a HWP in that case. Since this is tied to adding a provider account, the whole transaction will fail.

There's no reason that zero should be invalid for storage. The validation should be changed to just require that it be non-negative (i.e., >= 0, not just >0.)

A little outside the scope of this task, but perhaps importing provider HWPs should be moved into a background task after the Provider Account is added.


Version-Release number of selected component (if applicable):
Upstream master, but probably all releases


Steps to Reproduce:
1. Outside Conductor, set up a cloud provider with a 0GB hardware profile. (OpenStack seems to do this out of the box.) I have a box on the internal network that does this if need be.
2. Add that as a provider.
3. Attempt to save a provider account for it.

Actual results:
Save fails, with:
Cannot add the Provider Account.
Errors

    1 error prohibited this Provider Account from being saved
    Failed to populate hardware_profiles: Validation failed: Storage is invalid



Expected results:
Save should succeed because 0GB is valid.


Additional info:
I cannot find a previous BZ for this, but have a strong feeling of deja vu here.

Comment 2 Matt Wagner 2012-09-18 13:23:46 UTC
Pull request sent: https://github.com/aeolusproject/conductor/pull/64

Comment 3 Matt Wagner 2012-10-02 16:56:02 UTC
On 1.1, cherry-picked from master:

commit 21a4725d997a724f3bea0fff1eec75933b54c775
Author: Matt Wagner <matt.wagner>
Date:   Mon Sep 17 17:40:54 2012 -0400

    BZ 858030 - Allow 0 storage in HWPs
    
    A hardware profile with no storage is a valid configuration,
    so Conductor should accept it.
    
    Resolves https://bugzilla.redhat.com/show_bug.cgi?id=858030
    (cherry picked from commit f684804bd558e658fa1543c85ff6be0a572a442e)