Bug 806776

Summary: oVirt CLI : cannot create storagedomain via oVirt CLI
Product: [Retired] oVirt Reporter: Avihai Shoham <ashoham>
Component: ovirt-engine-cliAssignee: Michael Pasternak <mpastern>
Status: CLOSED NOTABUG QA Contact:
Severity: urgent Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: acathrow, bazulay, dyasny, ecohen, iheim, mgoldboi, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-26 14:22:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
email-thread none

Description Avihai Shoham 2012-03-26 08:14:38 UTC
Created attachment 572694 [details]
email-thread

i'm getting exception after entering 
[oVirt shell (connected)]# create storagedomain --host-name gold-vdsc --type iscsi --storage-type data --datacenter-identifier "1827abcf-5c2f-49d0-b062-83a7251fcf38" --id "a"


It appears that it fails because of the [--id "a"] 
without it the command failed
see http://pastebin.test.redhat.com/82506

observed by Ori

see attached

Comment 1 Michael Pasternak 2012-03-26 14:22:21 UTC
this is not correct, the action you perform is /attach/ of SD to DC,
and since it done via POST as creates, its done by CREATE command in CLI,
and id is obviously mandatory as you have to tell api which SD to attach,

and again Avihi (this is not first time) you doing exactly the same mistake again, supplying string where option name is /id/!, 

even in exception you can see: "Invalid UUID string: a" ...,
please pay attention on this things!

for creating SD, see help in 'help create storagedomain'

Comment 2 Avihai Shoham 2012-03-26 14:38:54 UTC
Michael, i disagree on a status "not a bug"
did you manage to create SD? 
as i wrote you in the email this was a wrong pastebin. see
http://pastebin.test.redhat.com/82928

it happen with names as well . 

few facts 
(A)
 id|name is required to complete this command. and as it looks it related to storagedomain name that a user should give, if not he will get the below error , and from that point any string|ID that he will enter will results with exception


[oVirt shell (connected)]# create storagedomain --host-name gold-vdsc --type iscsi --storage-type data --datacenter-identifier "1827abcf-5c2f-49d0-b062-83a7251fcf38" 
unknown error: 
status: 400
reason: Bad Request
detail: StorageDomain [id|name] required for add

(B)
help create storagedomain
has it own bugs ,as the lined there are multiple 

* --format: boolean
    * --format: boolean
    * --format: boolean
    * --host-id|name: string
    * --host-id|name: string
    * --host-id|name: string
    * --name: string
    * --name: string
    * --name: string
    * --storage-address: string
    * --storage-path: string
    * --storage-path: string
    * --storage-type: string
    * --storage-type: string
    * --storage-type: string
    * --type: string
    * --type: string
    * --type: string
    * [--storage-logical_units-logical_unit-address: string]
    * [--storage-logical_units-logical_unit-address: string]
    * [--storage-logical_units-logical_unit-address: string]
    * [--storage-logical_units-logical_unit-id: string]
    * [--storage-logical_units-logical_unit-id: string]
    * [--storage-logical_units-logical_unit-id: string]
    * [--storage-logical_units-logical_unit-lun_mapping: int]
    * [--storage-logical_units-logical_unit-lun_mapping: int]
    * [--storage-logical_units-logical_unit-lun_mapping: int]
    * [--storage-logical_units-logical_unit-password: string]
    * [--storage-logical_units-logical_unit-password: string]
    * [--storage-logical_units-logical_unit-password: string]

Comment 3 Avihai Shoham 2012-03-26 14:57:09 UTC
sorry - replacing preview comments with the follow one.

i agreed with Ori that this is an issue and file ths BZ

The help command  is not clear

could you please elaborate on what a user should enter.
i tried to create SD , when i miss the id|name CLI return with "StorageDomain [id|name] required for add"

obviously as a user i enter the missing params.

now you say that "you have to tell api which SD to attach," 

i show to few people  and the feeling this command not so intuitive

in any case exception should not occur.

Comment 4 Avihai Shoham 2012-03-26 16:11:36 UTC
in addition , please sync with Ori as you was out of the loop in that case
i'm trying to create storage and not attached

the existing of both options in "create SD" command are not healthy

i will fetch recent sdk&cli and check this issue, as Ori said that few changes were made in the last week.

Comment 5 Michael Pasternak 2012-03-26 16:18:34 UTC
iiuc you want to create the SD, but using attach-sd arguments....,
where do you see in 'help create storagedomain'  --datacenter-identifier
option?

it's not there, by supplying it you change from CREATE SD to 
ATTACH SD, - this is how our API build and this is ain't related to CLI

please use only options mentioned in help and all will work for you.

- also there is nothing to sync, when you open bug among
supplying arguments you used, please explain what you trying to achieve,
the description you used was not much informative.

Comment 6 Michael Pasternak 2012-03-26 16:59:18 UTC
As about Comment 2, you using old and not official SDK that you build
by yourself, as i already mentioned please use *only* rpms officially
released in ovirt upstream repo.

thanks.