Graceful shutdown time is far more than configuration time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Triaged
|
Low
|
Unassigned |
Bug Description
Description
===========
When we set shutdown_timeout in /etc/nova/nova.conf and then shutdown the instance, the shutdown time is much longer than the value we configure.
This is due to the fact: shutdown_timeout is used as the number of loops, not the loop time. In a loop, the code calls libvirt constantly to query the virtual machine status. So, loop time is much longer than configuration.
The code looks like this:
for sec in range(shutdown_
query instance status
sleep(1)
Steps to reproduce
==================
1. deploy a instance in your openstack
2. configure shutdown_timeout of the comopute node where the instance was deployed at
3. restart compute service
4. shutdown the instance
Expected result
===============
Shutdown takes about the same amount of time as configuration.
Actual result
=============
Shutdown takes much more time than configuration time. For example, shutdowm_
Environment
===========
[root@nail1 ~]# rpm -qa | grep nova
openstack-
openstack-
python2-
openstack-
openstack-
openstack-
openstack-
python-
openstack-
openstack-
Yup code is here:
https:/ /github. com/openstack/ nova/blob/ 926e584136e7dce 59f32065292aa4e b8120f628c/ nova/virt/ libvirt/ driver. py#L2914- L2947
This code could probably be cleaned up by using FixedIntervalWi thTimeoutLoopin gCall from the oslo.service library:
https:/ /github. com/openstack/ oslo.service/ blob/1. 38.0/oslo_ service/ loopingcall. py#L197