Bug #27655
closed[Kubevirt-Foreman] Host creation via API ignores CPUs count specified in request
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1738472
Description of problem:
When creating a host on Satellite using API the host is created successfully, but always with one CPU only, regardless the core request specified in JSON.
Version-Release number of selected component (if applicable):
Satellite 6.6.0 snap 14:
satellite-6.6.0-5.beta
tfm-rubygem-foreman_kubevirt-0.1.4-1
tfm-rubygem-fog-kubevirt-1.3.1-1
How reproducible:
always
Steps to Reproduce:
1. Specify a JSON request file like the following one, update with appropriate org, loc and other ids, choose "cores" count > 1:
vim req.json
{ "location_id" : "2",
"organization_id" : "1",
"host" : {
"name" : "test-api-4c",
"location_id" : "2",
"organization_id" : "1",
"compute_resource_id" : "1",
"provision_method" : "build",
"compute_attributes" : {
"cores" : "4",
"memory": "1073741824",
"volumes_attributes": {
"0": { "storage_class": "gluster-default-volume", "capacity": "2" }
}
},
"operatingsystem_id": "1",
"architecture_id" : "1",
"interfaces_attributes": {
"0" : {
"domain_id" : "1",
"name" : "test-api-4c",
"ip": "172.16.0.108",
"subnet_id" : "1",
"mac" : "00:03:14:15:92:04",
"managed" : "1",
"primary" : "1",
"provision" : "1",
"type": "Nic::Managed",
"virtual" : "0",
"compute_attributes" : {
"cni_provider" : "pod",
"network" : "ovs-net-1"
}
}
}
}
}
2. curl -u admin:password -H "Content-Type: application/json" -X POST -d @req.json --insecure https://<sat_fqdn>/api/hosts
3. Check the newly created host at the Satellite and OCP side.
Actual results:
The cores count is 1 regardless the value specified in JSON.
Expected results:
Cores count matching the value given in req.json file.
Additional info:
It is possible to create a host with more CPUs via UI successfully.
Tested against OCP v3.
Updated by Shira Maximov over 6 years ago
- Status changed from New to Closed
Applied in changeset hammer-cli-foreman-kubevirt|0bd449785bf1b5ab8b3f8062726e848d65a06e6b.
Updated by Shira Maximov over 6 years ago
- Pull request https://github.com/theforeman/hammer-cli-foreman-kubevirt/pull/16, https://github.com/theforeman/foreman_kubevirt/pull/116 added
Updated by Shira Maximov over 6 years ago
- Fixed in Releases hammer-cli-foreman-kubevirt_v0.1.4 added