Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1412768

Summary: [RFE] Allow specifying the destination Storage Domain when creating a VmPool with Python-SDK
Product: [oVirt] ovirt-engine Reporter: nicolas
Component: RestAPIAssignee: Michal Skrivanek <michal.skrivanek>
Status: CLOSED DEFERRED QA Contact: Lukas Svaty <lsvaty>
Severity: low Docs Contact:
Priority: unspecified    
Version: ---CC: bugs, juan.hernandez, michal.skrivanek, rbarry
Target Milestone: ---Keywords: FutureFeature
Target Release: ---Flags: rbarry: ovirt-4.5?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-01 14:48:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description nicolas 2017-01-12 18:20:36 UTC
Description of problem:

We've several templates that have their disks replicated (copied) on all our Storage Domains. Problem is that we create our VmPools using PythonSDK, and it usually creates the pool on one of our Storage Domains that has a small amount of free disk space.

Some of the Data Stores have plenty of space and when creating the VmPool, we'd like to be able to specify on which of these Storage Domains to create the VmPool. So far I see no parameter on the params.VmPool class to do that. I've tried using an Action, but the request is not correct:

  action =
params.Action(storage_domain=api.storagedomains.get(name='...'))

  pool = params.VmPool(name='testlarge',
cluster=api.clusters.get(name='...'),
template=api.templates.get(name='Blank'), max_user_vms=1, size=1,
type_='manual', actions=action)
  pool = params.VmPool(name='testlarge',
cluster=api.clusters.get(name='...'),
template=api.templates.get(name='Blank'), max_user_vms=1, size=1,
type_='manual', actions=[action])

  api.vmpools.add(pool)

Both tries fail.

This is Python-SDK 3.x.

This seems to be unavailable at the moment. Could you please implement a way of specifying a destination Storage Domain when creating a VmPool?

Comment 1 Ondra Machacek 2017-01-16 11:22:04 UTC
The API model and SDK are designed to support this operation, but the backend is missing the functionality. SDK should be used as follows:

vm_pools_service.add(
    types.VmPool(
        name='myvmpool',
        size=5,
        cluster=types.Cluster(
            name='mycluster',
        ),
        template=types.Template(
            name='rhel7',
        ),
        vm=types.Vm(
            # Other parameters to override template predefined..
            disk_attachments=[
                types.DiskAttachment(
                    disk=types.Disk(
                        id='d3fe5185-bec8-4594-a647-cf50d9174e8b',
                        format=types.DiskFormat.COW,
                        storage_domains=[
                            types.StorageDomain(
                                id='48eb8b2d-37f1-4595-97e3-8896282c8ccc',
                            ),
                        ],
                    ),
                ),
            ],
        ),
    ),
)

Comment 2 Juan Hernández 2017-01-16 11:27:21 UTC
Michal, not sure if this should be Virt or Storage, what do you think? Please check and re-assign if needed.

Comment 3 Michal Skrivanek 2017-02-01 09:01:37 UTC
keep it virt

Comment 4 Michal Skrivanek 2020-03-18 15:45:01 UTC
This bug didn't get any attention for a while, we didn't have the capacity to make any progress. If you deeply care about it or want to work on it please assign/target accordingly

Comment 5 Michal Skrivanek 2020-03-18 15:50:02 UTC
This bug didn't get any attention for a while, we didn't have the capacity to make any progress. If you deeply care about it or want to work on it please assign/target accordingly

Comment 6 Michal Skrivanek 2020-04-01 14:48:17 UTC
Closing old bug. Please reopen if still relevant/you want to work on it.