Bug 1206875 - Not possible to add vm to affinity group via cli
Summary: Not possible to add vm to affinity group via cli
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli
Version: 3.5.0
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Juan Hernández
QA Contact: Artyom
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-29 09:11 UTC by Artyom
Modified: 2019-10-10 09:48 UTC (History)
9 users (show)

Fixed In Version: ovirt-engine-cli-3.6.0.0-0.3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-09 19:55:02 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:
mavital: testing_plan_complete-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:0406 0 normal SHIPPED_LIVE rhevm-cli bug fix and enhancement update 2016-03-10 00:04:32 UTC
oVirt gerrit 39617 0 master MERGED cli: Always add -identifier and -name options Never

Description Artyom 2015-03-29 09:11:45 UTC
Description of problem:
Not possible to add vm to affinity group via cli
I tried two options:
1) first via affinitygroup collection, but I do not see any options in auto-completion connect to vm
2) second via update vm -> update vm Global_vm_1 --affinitygroup-identifier test_cli
but it not add vm to affinity group

Version-Release number of selected component (if applicable):
rhevm-cli-3.5.0.5-1.el6ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. See above
2.
3.

Actual results:
not possible to add vm to affinity group CLI

Expected results:
possible to vm to affinity group via CLI

Additional info:
maybe it possible, but I do not found this way, so I believe for user it will also hard to find it

Comment 1 Juan Hernández 2015-03-30 09:48:49 UTC
Affinity groups are represented as a sub-collection of clusters, so in order to add a VM to an affinity group you have to specify the identifier of the VM to add, the identifier of the cluster and the identifier of the affinity group:

  # add vm --id {vm:id} --cluster-identifier {cluster:id} --affinitygroup-identifier {affinitygroup:id}

This will work and will add the VM to the affinity group. However the "cluster-identifier" parameter doesn't appear in auto-completion, probably hidden by the "cluster-id" used when adding a new VM. We have to check this.

Updating the affinity group with an update of the VM isn't supported.

Comment 2 Artyom 2015-07-02 10:08:34 UTC
Checked on rhevm-cli-3.5.0.6-1.el6ev.noarch
I still not see --cluster-identifier under auto-complete options:
[RHEVM shell (connected)]# add vm 
affinitygroup-identifier           description                        instance_type-id                   quota-id
bios-boot_menu-enabled             disks-clone                        instance_type-name                 rng_device-rate-bytes
cluster                            disks-disk                         memory                             rng_device-rate-period
cluster-id                         display-allow_override             memory_policy-ballooning           rng_device-source
cluster-name                       display-copy_paste_enabled         memory_policy-guaranteed           serial_number-policy
comment                            display-file_transfer_enabled      migration_downtime                 serial_number-value
console-enabled                    display-keyboard_layout            name                               snapshots-snapshot
content                            display-monitors                   numa_tune_mode                     soundcard_enabled
correlation_id                     display-single_qxl_pci             origin                             sso-methods-method
cpu-architecture                   display-smartcard_enabled          os-boot                            stateless
cpu-cpu_tune-vcpu_pin              display-type                       os-cmdline                         template-id
cpu-mode                           domain-name                        os-initRd                          template-name
cpu-topology-cores                 expect                             os-kernel                          timezone
cpu-topology-sockets               high_availability-enabled          os-type                            tunnel_migration
cpu_profile-id                     high_availability-priority         payloads-payload                   type
cpu_shares                         id                                 permissions-clone                  usb-enabled
custom_properties-custom_property  initialization-configuration-data  placement_policy-affinity          usb-type
datacenter-identifier              initialization-configuration-type  placement_policy-host-id           use_latest_template_version
delete_protected                   initialization-regenerate_ids      placement_policy-host-name         virtio_scsi-enabled

Comment 3 Artyom 2015-07-02 10:09:12 UTC
Thought it connect to 3.5.4 build my mistake, back to ON_QA

Comment 4 Artyom 2015-07-02 10:47:24 UTC
Checked on ovirt-engine-cli-3.6.0.0-0.3.20150623.git53408f5.el6.noarch

I still not see --cluster-identifier under auto-complete options:
add vm --id 2f08a2e7-2423-4467-b588-2760c2ea5913 cluster-
cluster-id    cluster-name

Comment 5 Juan Hernández 2015-07-02 11:03:26 UTC
In order to fix bug 1213393 a new set of --parent-whatever-name and --parent-whatever-identifier options have been introduced to specify the parent entities. The old --whatever-id option are still supported, for backwards compatibility, but the aren't displayed in the auto completion list, the new ones are displayed instead. So in the list you should see the following options:

  parent-cluster-name
  parent-cluster-identifier
  parent-affinitygroup-name
  parent-affinitygroup-identifier

In order to add a VM to the affinity group you can then use the following command:

  # add vm 123 --parent-cluster-identifier 456 --parent-affinitygroup-identifier 789

You can also use the names, if you prefer that:

  # add vm 123 --parent-cluster-name mycluster --parent-affinitygroup-name mygroup

I think that no additional changes are needed, so I'm moving back to ON_QA.

Comment 6 Artyom 2015-07-02 12:08:12 UTC
Thanks for description, but like I checked add vm 123 --parent-cluster-identifier 456 --parent-affinitygroup-identifier 789 not work, but
add vm --id 2f08a2e7-2423-4467-b588-2760c2ea5913 --parent-cluster-name cl_36_amd --parent-affinitygroup-name test
and 
add vm --id 6bbe63c9-6532-4f5b-8d83-4ef0103f113a --parent-cluster-identifier 8663f496-8d35-467a-a3af-fdebd560e745 --parent-affinitygroup-identifier 10b22342-ca2d-4a85-abcc-14ab134b5b1c

Works great.
Verified on ovirt-engine-cli-3.6.0.0-0.3.20150623.git53408f5.el6.noarch

Comment 8 errata-xmlrpc 2016-03-09 19:55:02 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/RHEA-2016-0406.html


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