Bug 1143967
| Summary: | Rest-api's add disk logged with NONE variable,Adding Disk <UNKNOWN> | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Ori Gofen <ogofen> | ||||||
| Component: | ovirt-engine | Assignee: | Tal Nisan <tnisan> | ||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Raz Tamir <ratamir> | ||||||
| Severity: | low | Docs Contact: | |||||||
| Priority: | low | ||||||||
| Version: | 3.5.0 | CC: | acanan, amureini, bazulay, ecohen, gklein, iheim, juan.hernandez, lpeer, lsurette, ogofen, oramraz, pstehlik, rbalakri, Rhev-m-bugs, scohen, yeylon | ||||||
| Target Milestone: | --- | Flags: | scohen:
Triaged+
|
||||||
| Target Release: | 3.5.0 | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | storage | ||||||||
| Fixed In Version: | org.ovirt.engine-root-3.5.0-21 | Doc Type: | Bug Fix | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | Type: | Bug | |||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | Storage | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
Can you attach to the bug the Python SDK script that you used to create the disk? Also, if possible, run that script with the debug=True option and attach the output as well. Note that the output will contain your password in the "Authorization" header. Juan, just to clarify - are you taking this, or should someone from my team take lead on this? I would like to check what the Python SDK is sending, then I can have a better understanding of what is happening. Once I have a better understanding I may redirect it to your team. I'm changing the whiteboard to "infra" to make that explicit, however I may change it back to "storage" later. (In reply to Juan Hernández from comment #3) > I would like to check what the Python SDK is sending, then I can have a > better understanding of what is happening. Once I have a better > understanding I may redirect it to your team. I'm changing the whiteboard to > "infra" to make that explicit, however I may change it back to "storage" > later. Sure, no problem. If you need any help from our side, just say so. Thanks! Created attachment 940305 [details]
debug log + the script I have used
hope this help.
What I see here is that the Python SDK script that you are using to create the disk is not setting the disk alias. As a result the backend will assign an alias automatically. But this name is assigned after the command is logged, so while it is being logged the alias doesn't have a value yet, thus it appears as <UNKNOWN>.
You can workaround this issue assigning the disk alias in your script, for example:
b=params.Disk(alias=vm_str + "_disk", ...)
Note directly related to this, but I also see in your script that you are taking objects from the API and passing them as parameters to other calls. This isn't good practice. For example, you are taking the storage domain object like this:
sd_iscsi=api.storagedomains.list()[0]
And then you are using it to create the disk like this:
b=params.Disk(storage_domains=params.StorageDomains(storage_domain=[sd_iscsi]), ...)
That is ok, and works, but it also means that you are sending the complete definition of the storage domain, including the definition of its 30 logical units, to the server. All that data will just be ignored, and makes your request slower. Try to send only the identifier, for example:
storagedomain_id = api.storagedomains.get("mydata").get_id()
disk = params.Disk(
storage_domains=params.StorageDomains(
storage_domain=[
params.StorageDomain(id=storagedomain_id)
]
),
alias="mydisk",
...
)
vm.disks.add(disk)
Just to be clear, if we want to fix this bug we need to assign the alias to the disk before logging the command. verified - vt12 RHEV-M 3.5.0 has been released, closing this bug. RHEV-M 3.5.0 has been released, closing this bug. |
Created attachment 938833 [details] image_from_tasks_messages_tab Description of problem: Adding disk from rest-api, py-sdk sends NONE variable to oVirt,the message in the TASKS tab is unclear (see image),"Adding Disk <UNKNOWN>". Version-Release number of selected component (if applicable): vt3.1 How reproducible: 100% Steps to Reproduce: 1.add disk using py-sdk Actual results: operation is wrongly logged Expected results: adding disk,$DISK_NAME Additional info: UI operation are clear but I believe a comma is missing between disk and $DISK_NAME