Bug 1425731
Summary: | APIv4: StorageDomainVmService.register should have reassign_bad_macs, not import_ | ||
---|---|---|---|
Product: | [oVirt] ovirt-engine-sdk-python | Reporter: | Ondřej Svoboda <osvoboda> |
Component: | Core | Assignee: | Ondra Machacek <omachace> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Ori Ben Sasson <obensass> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4.1.0a | CC: | bugs, danken, juan.hernandez, myakove, omachace |
Target Milestone: | ovirt-4.1.1 | Flags: | rule-engine:
ovirt-4.1+
rule-engine: exception+ |
Target Release: | 4.1.1 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | python-ovirt-engine-sdk4-4.1.1-1.el7ev | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-04-21 09:33:24 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | Network | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Ondřej Svoboda
2017-02-22 09:10:53 UTC
A fix has been merged and backported. Before considering this MODIFIED a new release of the API specification has to be published, containing the fix, and then the Python SDK needs to be updated to use that version. I am moving the bug back to NEW and reassigning it. Hi Ondra, could you please explain me how to verify this bug? As explained in the description the 'register' action missed the option to specify following attributes: - vnic_profile_mappings - reassign_bad_macs during the register operation. So in order to test it try to pass that parameters to the register action: --- import logging import ovirtsdk4 as sdk import ovirtsdk4.types as types logging.basicConfig(level=logging.DEBUG, filename='example.log') # This example will connect to the server and start a virtual machine. # Create the connection to the server: connection = sdk.Connection( url='https://engine/ovirt-engine/api', username='admin@internal', password='123', ca_file='ca.pem', debug=True, log=logging.getLogger(), ) # Get the reference to the "storage_domains" service: storage_domains_service = connection.system_service().storage_domains_service() # Find the storage domain with unregistered VM: sd = storage_domains_service.list(search='name=mysd')[0] # Locate the service that manages the storage domain, as that is where # the action methods are defined: storage_domain_service = storage_domains_service.storage_domain_service(sd.id) # Locate the service that manages the VMs in storage domain: vms_service = storage_domain_service.vms_service() # Find the the unregistered VM we want to register: vms = vms_service.list(unregistered=True) vm = next( (v for v in vms if v.name == 'myvm'), None ) # Locate the service that manages the storage domain, as that is where # the action methods are defined: vm_service = vms_service.vm_service(vm.id) # Register the VM into the system: vm = vm_service.register( cluster=types.Cluster( name='mycluster', ), vm=types.Vm( name='exported_myvm', ), vnic_profile_mappings=[ types.VnicProfileMapping( source_network_name='mynetwork', source_network_profile_name='mynetwork', target_vnic_profile=types.VnicProfile( name='mynetwork', ), ), ], reassign_bad_macs=True, ) # Close the connection to the server: connection.close() --- Verified on python-ovirt-engine-sdk4-4.1.3-1.el7ev.x86_64 |