Description of problem: There is an option to create CDROM using RHEVM shell , this option is documented in the CLI guide as well . I'm not familiar with such option in UI . Maybe it attach CDROM to VM ( need to be done as action ) , or set default CDROM for a VM . Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: ## from the documentation Use the create cdrom command to create a new virtual CD-ROM for your installation media. Add the vm-identifier option to attach the CD-ROM as a sub-resource of MyVM. [oVirt shell (connected)]# create cdrom --vm-identifier MyVM --file-id rhel-server-6.0-x86_64-dvd.iso [RHEVM shell (connected)]# create cdrom --vm-identifier correlation_id expect file-id vm
attach of cdrom in api done via CREATE in /api/vms/xxx/cdroms, same in sdk/cli -> create cdrom --vm-identifier xxx --file-id yyy
What exactly the CLI create ? We have two possible ways to decide which cdrom the VM will run with: 1. During VM creation / update VM 2. Using Change CD We don't have any way to create "floating" cdrom using RHEVM , I think the current behavior and documentation is misleading . (In reply to comment #1) > attach of cdrom in api done via CREATE in /api/vms/xxx/cdroms, > same in sdk/cli -> create cdrom --vm-identifier xxx --file-id yyy
(In reply to comment #2) > What exactly the CLI create ? We have two possible ways to decide which > cdrom the VM will run with: oded, please see previous comment, it's not cli, it's the api structure -> to add resource to collection, you CREATE it in this collection -> CREATE in /api/vms/xxx/cdroms > 1. During VM creation / update VM > 2. Using Change CD > > We don't have any way to create "floating" cdrom using RHEVM , I think the > current behavior and documentation is misleading . > > (In reply to comment #1) > > attach of cdrom in api done via CREATE in /api/vms/xxx/cdroms, > > same in sdk/cli -> create cdrom --vm-identifier xxx --file-id yyy
I understand the confusion, however the CLI concept (concepts are to late to change) is to be compatible with the API. In the API, to place an entity into sub collection is to create it there. What you are creating is a reference (in case of an existing object like a disk) or an object that must reside in a collection (Like nics or CDROM) So CDROM is a collection: https://rhevm31.mylaptop.redhat.com/api/vms/7cfd0163-422c-4fdf-869e-37378a754761/cdroms And you create a CDROM in the collection context, the same as you do for Nics <cdroms><cdrom href="/api/vms/7cfd0163-422c-4fdf-869e-37378a754761/cdroms/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"><vm href="/api/vms/7cfd0163-422c-4fdf-869e-37378a754761" id="7cfd0163-422c-4fdf-869e-37378a754761"/><file id="AnyDisk.iso"/></cdrom></cdroms> Michael, What I'm missing is the actions Change and Eject Is this achieved by updating the fileid? I think this is the confusing part. Reopening, Michael, I guess to add those you'll actually need to move it to the REST, right? If it can't be done then in any case this bug will need documentation.
> Michael, > What I'm missing is the actions Change and Eject > Is this achieved by updating the fileid? change is UPDATE eject is a DELETE * same as in any other api resource > > I think this is the confusing part. > > Reopening, > Michael, I guess to add those you'll actually need to move it to the REST, > right? > > If it can't be done then in any case this bug will need documentation.
btw cdrom is not a property by <cdrom> resource in <cdroms> collection
(In reply to comment #6) > > Michael, > > What I'm missing is the actions Change and Eject > > Is this achieved by updating the fileid? > > change is UPDATE > eject is a DELETE > This is confusing, since eject will not remove the CDROM device from the VM While the concept may work well with other sub-collections, I think we need Eject/Change CD are in order for the CLI. Don't forget that the CLI is the UI equivalent, it has to be user friendly. So if it requires the API to provide those actions so be it.
(In reply to comment #8) > (In reply to comment #6) > > > Michael, > > > What I'm missing is the actions Change and Eject > > > Is this achieved by updating the fileid? > > > > change is UPDATE > > eject is a DELETE > > > > This is confusing, since eject will not remove the CDROM device from the VM i don't know what the 'eject' is, this is GUI term, in api: UPDATE -> VdcActionType.ChangeDisk DELETE -> removes CD from vm * this is documented since 2.3 api what is works perfectly well from REST/sdk/cli collection concept PoV, don't forget that in real world cdrom is vm property, but in api we have collection of cdroms ...
Decided to add new command : "add" in order to add cdrom to existing VM , instead of the former "create" operation .
(In reply to comment #9) > (In reply to comment #8) > > (In reply to comment #6) > > > > Michael, > > > > What I'm missing is the actions Change and Eject > > > > Is this achieved by updating the fileid? > > > > > > change is UPDATE > > > eject is a DELETE > > > > > > > This is confusing, since eject will not remove the CDROM device from the VM > > i don't know what the 'eject' is, this is GUI term, Correction - 'eject' is the term humans uses to EJECT a CD. GUI, Documentation, in writing and when people talk to each other. 'remove' is also sometimes used, but less often. Never heard of anyone referring to that action as 'delete'. > > in api: > > UPDATE -> VdcActionType.ChangeDisk > DELETE -> removes CD from vm > > * this is documented since 2.3 api > > what is works perfectly well from REST/sdk/cli collection concept PoV, > don't forget that in real world cdrom is vm property, but in api we have > collection of cdroms ...
Oded, we did not agreed on this change on yesterday's meeting.
(In reply to comment #10) > Decided to add new command : "add" in order to add cdrom to existing VM , > instead of the former "create" operation . we decided not to add new 'add' command for the cdrom, but rename existent 'create' to 'add'
(In reply to comment #11) > (In reply to comment #9) > > (In reply to comment #8) > > > (In reply to comment #6) > > > > > Michael, > > > > > What I'm missing is the actions Change and Eject > > > > > Is this achieved by updating the fileid? > > > > > > > > change is UPDATE > > > > eject is a DELETE > > > > > > > > > > This is confusing, since eject will not remove the CDROM device from the VM > > > > i don't know what the 'eject' is, this is GUI term, > > Correction - 'eject' is the term humans uses to EJECT a CD. GUI, > Documentation, in writing and when people talk to each other. > 'remove' is also sometimes used, but less often. > Never heard of anyone referring to that action as 'delete'. i don't mind renaming 'delete' to 'remove' if you find it better, please file+approve new bug, thanks. > > > > > in api: > > > > UPDATE -> VdcActionType.ChangeDisk > > DELETE -> removes CD from vm > > > > * this is documented since 2.3 api > > > > what is works perfectly well from REST/sdk/cli collection concept PoV, > > don't forget that in real world cdrom is vm property, but in api we have > > collection of cdroms ...
*** This bug has been marked as a duplicate of bug 855773 ***