Bug 1148827 - [REGENERATE PYTHON SDK] Unable to get unregistered vms in SDK
Summary: [REGENERATE PYTHON SDK] Unable to get unregistered vms in SDK
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-sdk
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.5.0
Assignee: Juan Hernández
QA Contact: Petr Matyáš
URL:
Whiteboard: infra
Depends On: 1148715
Blocks: rhev3.5beta3
TreeView+ depends on / blocked
 
Reported: 2014-10-02 13:19 UTC by Juan Hernández
Modified: 2016-02-10 19:42 UTC (History)
13 users (show)

Fixed In Version: rhevm-sdk-python-3.5.0.7-3.el6ev
Doc Type: Bug Fix
Doc Text:
Clone Of: 1148715
Environment:
Last Closed: 2015-02-11 21:13:55 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0183 0 normal SHIPPED_LIVE rhevm-sdk-python bug fix and enhancement update 2015-02-12 01:36:21 UTC

Description Juan Hernández 2014-10-02 13:19:21 UTC
+++ This bug was initially created as a clone of Bug #1148715 +++

Description of problem:
To get unregistered vms thorough REST api:
GET /api/storagedomain/{sd_id:'xxxx'}/vms;unregistered

in SDK this behaviour isn't supported  

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Juan Hernández on 2014-10-02 09:16:48 EDT ---

This happens because the "unregistered" parameter isn't included in the RSDL metadata for the storagedomains/{storagedomain:id}/vms collection.

Once this is fixed the SDKs will need to be regenerated.

Comment 2 Juan Hernández 2014-10-22 13:25:55 UTC
To test perform the following actions with the GUI:

1. In the engine run "engine-config -s OvfUpdateIntervalInMinutes=1" and then restart with "service ovirt-engine restart".

2. Create 2 storage domains in the same data center.

3. On the non-master storage domain create a virtual machine with disks.

4. Once the virtual machine is created move the non-master storage domain to maintenance and detach it from the data center. The virtual machine will disappear from the GUI.

5. Attach the storage domain again. The virtual machine should appear in the "vm import" subtab. That is an "unregistered" virtual machine.

Then try the following Python script, which should list the unregistered virtual machines:

#!/usr/bin/python

import ovirtsdk.api
import ovirtsdk.xml

api = ovirtsdk.api.API(
  url="https://ovirt.example.com/ovirt-engine/api",
  username="admin@internal",
  password="******",
  ca_file="/etc/pki/ovirt-engine/ca.pem"
)

sd = api.storagedomains.get(name="mydata")
for vm in sd.vms.list(unregistered=True):
    print(vm.get_name())

api.disconnect()

These instructor were kindly provided by Raz Tamir.

Comment 4 errata-xmlrpc 2015-02-11 21:13:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0183.html


Note You need to log in before you can comment on or make changes to this bug.