Bug 1937470
Summary: | hammer does not have a compute resource associate VMs command as web UI has | |||
---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Vedashree Deshpande <vdeshpan> | |
Component: | Compute Resources | Assignee: | aabramov | |
Status: | CLOSED ERRATA | QA Contact: | Lukáš Hellebrandt <lhellebr> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 6.8.0 | CC: | aabramov, apatel, ehelms, inecas, jjeffers, kgaikwad, ktordeur, mhulan, oezr, ofedoren, pcreech, rabajaj, tbrisker, zhunting | |
Target Milestone: | 6.11.0 | Keywords: | Triaged | |
Target Release: | Unused | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | If docs needed, set a value | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 2027351 (view as bug list) | Environment: | ||
Last Closed: | 2022-07-05 14:28:45 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: |
Description
Vedashree Deshpande
2021-03-10 17:37:45 UTC
This is weird because if the host is not VMware it shouldn't update it to VMware without providing any other relevant compute attributes, When I tried to do this I received this error: Could not update the host: Failed to find compute attributes, please check if VM marty-lintner.tlv.redhat.com was deleted However, when I try to update a parameter that can be changed without any more attributes (for example hostname) the update works well and updates only the host that I specified with the --id option. So I am not sure there is a bug here. Can you please provide more details on the host you are trying to update? Hello Yifat, The expectations in customers words are as follows: ~~~ I need to automate the "Associate VM" task for a specific VM. This task is usually performed by the Satellite GUI, on the Compute Resource section. Currently, I'm able to automate it only by using the following API call, however doing so it also associates all the VMs to the compute resource, instead of only the required one: curl --header "Content-Type:application/json" --request PUT --user username:password --insecure https://satellite.example.com/api/v2/compute_resources/2/associate | python -m json.tool So the previous command you provided me: # hammer host update --id 39 --compute-resource VMWARE doesn't have any issue, but it doesn't meet my needs, because using it the host hasn't been associated with the compute resource. In fact it doesn't have the power controls on the host screen in the GUI. This command adds only the "Deploy on" entry in the host settings, and it doesn't actually execute the "Associate VM" task such as from the GUI (in Compute Resource section). ~~~ I hope this helps to get clarity of the issue. Created redmine issue https://projects.theforeman.org/issues/32271 from this bug Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32271 has been resolved. With Sat 6.10.0 snap 5.0: # hammer compute-resource --help | grep associate-vms associate-vms Associate VMs to Hosts # hammer compute-resource associate-vms --help Usage: hammer compute-resource associate-vms [OPTIONS] Options: --id ID [...] # hammer compute-resource associate-vms --id 65 Virtual machines have been associated. => The machine has indeed been associated with the CR. The CR is filled correctly in Host -> Edit -> Deploy on and power operations work. Note this happens for all the machines on that CR. Failed as per comment 6. While it is nice that it is now possible to associate all the VMs on a certain CR, that's not what customer asked for. Customer wants to be able to associate one single VM, not all the VMs on a CR. Connecting redmine issue https://projects.theforeman.org/issues/33047 from this bug *** Bug 1774104 has been marked as a duplicate of this bug. *** Verified with Sat 7.0 snap 7.0 but a followup BZ reported. I have Hosts created with MAC addresses of lhellebr-bz2, respectively lhellebr-bz3 VMs set as a precondition, none of them is associated to any CR. # hammer compute-resource --help | grep associate associate-vms Associate VMs to Hosts # hammer compute-resource associate-vms --help | grep vm-id --vm-id VALUE Associate a specific VM # hammer compute-resource virtual-machines --id 1 | grep bz 500dc585-b074-b7ee-a1ec-332f40a698cb | lhellebr-bz3 500d8cfc-6442-a658-147f-bd9717a90ac5 | lhellebr-bz2 # hammer compute-resource associate-vms --id 1 --vm-id 500d8cfc-6442-a658-147f-bd9717a90ac5 Virtual machines have been associated. # hammer compute-resource associate-vms --id 1 --vm-id 500d8cfc-6442-a658-147f-beefface Could not associate the virtual machines: Resource compute_resource not found by id '1' => Looking in WebUI, I see that lhellebr-bz2 has been associated to the CR and lhellebr-bz3 has not been associated to anything. However, when in the second associate-vms call, I purposefully used an incorrect VM id, a misleading error appeared stating that CR id is incorrect while in fact, VM id is incorrect. Followup BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2049759 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 (Moderate: Satellite 6.11 Release), 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://access.redhat.com/errata/RHSA-2022:5498 *** Bug 2027351 has been marked as a duplicate of this bug. *** |