Placement API appears to have issues when compute host replaced
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Expired
|
Undecided
|
Unassigned |
Bug Description
We have been upgrading our sites from RDO to OSA. This process involved live migrating all VMs from a compute host before reinstalling it with OSA playbooks.
Note: the compute host is not "removed" from openstack in anyway; the new OSA node is the *same* hardware, same hostname etc - just reinstalled as OSA.
This appears to have consequences for the way the placement API works - we have noticed that when live migrating the scheduler will often choose a highly loaded node where an empty node exists - for example - in the below output from my live migration script the VM is being migrated from cc-compute04-kna1; the scheduler has chosen cc-compute01-kna1 as the target this despite the load it currently has, and that compute09, 15 and 18 are all empty
Migration Destination: cc-compute01-kna1
Migration ID: 12993
+------
+------
| Host | Project | CPU | Memory MB | Disk GB |
+------
| cc-compute04-kna1 | (used_now) | 124 | 254976 | 2790 |
| cc-compute01-kna1 | (used_now) | 230 | 466432 | 8210 |
+------
| cc-compute03-kna1 | (used_now) | 174 | 327680 | 4740 |
| cc-compute05-kna1 | (used_now) | 198 | 457728 | 4430 |
| cc-compute06-kna1 | (used_now) | 163 | 366592 | 4650 |
| cc-compute07-kna1 | (used_now) | 170 | 415744 | 4460 |
| cc-compute08-kna1 | (used_now) | 178 | 382464 | 4750 |
| cc-compute09-kna1 | (used_now) | 0 | 2048 | 0 |
| cc-compute11-kna1 | (used_now) | 131 | 313856 | 3100 |
| cc-compute12-kna1 | (used_now) | 176 | 392704 | 4800 |
| cc-compute13-kna1 | (used_now) | 173 | 390656 | 5470 |
| cc-compute14-kna1 | (used_now) | 2 | 4096 | 50 |
| cc-compute15-kna1 | (used_now) | 0 | 2048 | 0 |
| cc-compute16-kna1 | (used_now) | 170 | 355840 | 5410 |
| cc-compute17-kna1 | (used_now) | 281 | 646656 | 5370 |
| cc-compute18-kna1 | (used_now) | 0 | 2048 | 0 |
| cc-compute19-kna1 | (used_now) | 207 | 517120 | 4860 |
| cc-compute20-kna1 | (used_now) | 223 | 560640 | 5150 |
| cc-compute23-kna1 | (used_now) | 184 | 406528 | 6350 |
| cc-compute24-kna1 | (used_now) | 190 | 585216 | 4820 |
| cc-compute25-kna1 | (used_now) | 235 | 491520 | 5500 |
| cc-compute26-kna1 | (used_now) | 283 | 610304 | 9390 |
| cc-compute27-kna1 | (used_now) | 200 | 573440 | 6730 |
| cc-compute28-kna1 | (used_now) | 269 | 587264 | 6600 |
| cc-compute29-kna1 | (used_now) | 245 | 494080 | 8480 |
+------
this is not an isolated case, and is something we have seen frequently to the point where we override the scheduler and use targeted migrations to achieve better load balancing.
Interrogating the Placement API for a compute (09) prior to reinstallation I can find the UUID
{
{
},
{
},
{
},
{
}
],
"name": "cc-compute09-
"uuid": "d6aeeeb0-
},
after the node is reinstalled it has a new UUID
{
{
},
{
},
{
},
{
}
],
"name": "compute09.
"uuid": "d7f483ff-
},
this new resource provider shows 0 consumed resources
curl -g -X GET http://
% Total % Received % Xferd Average Speed Time Time Time Current
100 89 100 89 0 0 2870 0 --:--:-- --:--:-- --:--:-- 2870
{
"resource_
"usages": {
"DISK_GB": 0,
"VCPU": 0
}
}
investigating the resource_providers table shows pottential duplicate entries -
MariaDB [nova_api]> select * from resource_providers;
+------
| created_at | updated_at | id | uuid | name | generation | can_host | root_provider_id | parent_provider_id |
+------
| 2018-04-25 21:25:32 | 2019-04-17 07:08:24 | 1 | cbb2c235-
| 2018-04-25 21:44:17 | 2019-05-02 13:23:34 | 2 | 6125fdeb-
| 2018-04-25 22:13:01 | 2019-05-20 13:11:55 | 3 | 452b7f99-
| 2018-04-25 22:13:08 | 2019-06-10 12:28:41 | 4 | 03b420df-
| 2018-04-25 22:13:08 | 2019-06-14 06:29:47 | 5 | 9386d418-
| 2018-04-25 22:46:46 | 2019-05-20 13:39:00 | 6 | 7b0580e3-
| 2018-04-25 22:46:47 | 2019-04-19 18:53:45 | 7 | 98e1b299-
| 2018-04-25 22:46:50 | 2019-05-24 07:28:59 | 8 | 64c2b0fb-
| 2018-04-26 00:47:56 | 2019-06-11 20:43:47 | 11 | 61708a8f-
| 2018-04-26 00:48:01 | 2019-05-09 12:20:15 | 12 | 9e082274-
| 2018-04-26 00:48:04 | 2019-06-11 20:11:28 | 14 | 396bb173-
| 2018-04-26 00:48:06 | 2019-05-21 13:07:23 | 15 | 80e5f3a7-
| 2018-04-26 00:48:20 | 2019-05-16 14:32:54 | 18 | b86db974-
| 2018-04-26 00:48:20 | 2019-06-12 12:24:24 | 19 | dfb35aab-
| 2018-04-26 00:48:22 | 2019-05-07 10:55:46 | 20 | 4decfcd0-
| 2018-10-31 12:04:48 | 2019-04-24 08:32:36 | 28 | 266e5266-
| 2018-11-01 18:59:56 | 2019-06-14 06:29:52 | 34 | 5180de9c-
| 2018-11-01 18:59:56 | 2019-06-14 06:29:47 | 37 | 3a456de2-
| 2019-02-06 19:45:50 | 2019-06-14 06:29:39 | 43 | 0e5e6b94-
| 2019-02-06 19:45:50 | 2019-06-14 06:27:26 | 46 | 008c7549-
| 2019-02-10 17:45:03 | 2019-06-14 06:29:16 | 52 | 1fe21d2b-
| 2019-02-10 17:45:03 | 2019-06-14 06:29:08 | 55 | e636f01c-
| 2019-04-30 09:53:45 | 2019-06-14 06:29:36 | 76 | 34381a1c-
| 2019-04-30 13:20:12 | 2019-06-14 06:29:37 | 79 | 946fa4f1-
| 2019-05-08 08:26:45 | 2019-06-14 06:30:01 | 84 | 30a5e17b-
| 2019-05-08 08:27:01 | 2019-06-14 06:29:45 | 87 | 62f85460-
| 2019-05-13 11:37:50 | 2019-06-14 06:29:36 | 93 | 4e39206e-
| 2019-05-13 11:37:51 | 2019-06-14 06:29:46 | 96 | 6db0004d-
| 2019-05-17 11:50:50 | 2019-06-14 06:29:38 | 102 | 18a0a9f5-
| 2019-05-17 11:50:50 | 2019-06-14 06:29:16 | 105 | 97a16a89-
| 2019-05-29 11:20:15 | 2019-06-14 06:29:05 | 117 | e088c323-
| 2019-05-29 11:20:16 | 2019-06-14 06:29:27 | 120 | 58f85279-
| 2019-05-29 11:20:32 | 2019-06-14 06:29:52 | 123 | 58ac9048-
| 2019-06-11 09:15:59 | 2019-06-14 06:29:29 | 126 | 882f5ad3-
| 2019-06-11 09:16:23 | 2019-06-14 06:29:23 | 129 | 80e266f2-
| 2019-06-11 09:16:24 | 2019-06-14 06:29:25 | 132 | 09ef46fa-
| 2019-06-12 12:31:49 | 2019-06-14 06:29:08 | 138 | ebc9a09f-
| 2019-06-12 12:32:32 | 2019-06-14 06:29:53 | 141 | d982e5bb-
| 2019-06-13 19:42:01 | 2019-06-14 06:30:00 | 147 | ba89a743-
| 2019-06-13 19:42:24 | 2019-06-14 06:29:44 | 150 | 68f6b408-
| 2019-06-13 19:42:24 | 2019-06-14 06:29:21 | 153 | f981737a-
| 2019-06-13 19:42:25 | 2019-06-14 06:29:17 | 156 | d7f483ff-
| 2019-06-13 19:42:26 | 2019-06-14 06:29:09 | 159 | bc05c643-
+------
placement returns data on both UUIDs, for example compute18
curl -g -X GET http://
% Total % Received % Xferd Average Speed Time Time Time Current
100 98 100 98 0 0 2648 0 --:--:-- --:--:-- --:--:-- 2648
{
"resource_
"usages": {
"DISK_GB": 150,
"VCPU": 7
}
}
curl -g -X GET http://
% Total % Received % Xferd Average Speed Time Time Time Current
100 97 100 97 0 0 740 0 --:--:-- --:--:-- --:--:-- 740
{
"resource_
"usages": {
"DISK_GB": 680,
"VCPU": 32
}
}
i am speculating heavily on the cause of the issue however other symptoms we have seen
- live migration fails as no suitable host found (despite near empty nodes)
- new VMs fail to spawn as no suitable host found (despite near empty nodes)
these issues lead us to have to continually live migrate VMs to get some load balancing
other potentially useful input (or separate bugs)
nova-compute.log often has
2019-02-07 13:37:59.362 2632 INFO nova.compute.
we find this in normal running, but also have found it in relation to live migrations which have failed and have not been rolled back (for example as a result of the port_binding error)
it is also possible to get multiple entries in the services table, though I don't believe this is related, and will be reported in a separate bug
MariaDB [nova]> select host, services.binary, version from services where host="cc-
-> ;
+------
| host | binary | version |
+------
| cc-compute01-kna1 | nova-compute | 35 |
| cc-compute01-kna1 | nova-compute | 0 |
+------
A theory:
There appear to be a variety of issue at play here, but at least one of them is that though your compute09 is the same hardware and host, the before and after RDO->OSA switch versions have different names, which means that nova-compute and thus placement thinks they are different. That is, if these are the same physical node.
"name": "cc-compute09- kna1", openstack. local",
"name": "compute09.
It's looking like somewhere in the switch from RDO to OSA either hostnames or nova.conf settings have changed the name of the node. Then, since nothing has removed the resource provider records for the old names, placement is still returning results for them.
If it is a configuration setting issue, it could potentially explain why there are duplicate entries in the services table as well.
Does that have any potential to make sense?
Also when you respond please report what OpenStack version you're using (Stein, Queens, etc).