libvirt: Kill rsync/scp processes before deleting instance
In the resize operation, during copying files from source to
destination compute node scp/rsync processes are not aborted after
the instance is deleted because linux kernel doesn't delete instance
files physically until all processes using the file handle is closed
completely. Hence rsync/scp process keeps on running until it
transfers 100% of file data.
Added new module instancejobtracker to libvirt driver which will add,
remove or terminate the processes running against particular instances.
Added callback methods to execute call which will store the pid of
scp/rsync process in cache as a key: value pair and to remove the
pid from the cache after process completion. Process id will be used to
kill the process if it is running while deleting the instance. Instance
uuid is used as a key in the cache and pid will be the value.
Note: The required unit-tests are manually added to the below path,
as new path for unit-tests is not present in stable/juno release.
nova/tests/virt/libvirt/test_driver.py
nova/tests/virt/libvirt/test_utils.py
SecurityImpact
Closes-bug: #1466077
Change-Id: Ie03acc00a7c904aec13c90ae6a53938d08e5e0c9
(cherry picked from commit 7ab75d5b0b75fc3426323bef19bf436a258b9707)
(cherry picked from commit b5020a047fc487f35b76fc05f31e52665a1afda1)
(cherry picked from commit 539693e40388c4729c99a2c133b573896296df2a)
Conflicts:
nova/tests/virt/libvirt/test_image_utils.py
nova/tests/virt/libvirt/test_libvirt.py
nova/virt/libvirt/driver.py
Reviewed: https:/ /review. fuel-infra. org/11388 ci/fuel- 5.1.1-updates/ 2014.1. 1
Submitter: Vitaly Sedelnik <email address hidden>
Branch: openstack-
Commit: 55108287413606e 4ed2ed5a1730666 b828a289fc
Author: abhishekkekane <email address hidden>
Date: Tue Oct 27 12:42:23 2015
libvirt: Kill rsync/scp processes before deleting instance
In the resize operation, during copying files from source to
destination compute node scp/rsync processes are not aborted after
the instance is deleted because linux kernel doesn't delete instance
files physically until all processes using the file handle is closed
completely. Hence rsync/scp process keeps on running until it
transfers 100% of file data.
Added new module instancejobtracker to libvirt driver which will add,
remove or terminate the processes running against particular instances.
Added callback methods to execute call which will store the pid of
scp/rsync process in cache as a key: value pair and to remove the
pid from the cache after process completion. Process id will be used to
kill the process if it is running while deleting the instance. Instance
uuid is used as a key in the cache and pid will be the value.
Conflicts:
nova/tests/ unit/virt/ libvirt/ test_driver. py
nova/tests/ unit/virt/ libvirt/ test_utils. py
nova/virt/ libvirt/ driver. py
nova/virt/ libvirt/ utils.py
Note: The required unit-tests are manually added to the below path, virt/libvirt/ test_driver. py virt/libvirt/ test_utils. py
as new path for unit-tests is not present in stable/juno release.
nova/tests/
nova/tests/
SecurityImpact
Closes-bug: #1466077 aec13c90ae6a539 38d08e5e0c9 426323bef19bf43 6a258b9707) 35b76fc05f31e52 665a1afda1) 29c99a2c133b573 896296df2a) virt/libvirt/ test_image_ utils.py virt/libvirt/ test_libvirt. py libvirt/ driver. py
Change-Id: Ie03acc00a7c904
(cherry picked from commit 7ab75d5b0b75fc3
(cherry picked from commit b5020a047fc487f
(cherry picked from commit 539693e40388c47
Conflicts:
nova/tests/
nova/tests/
nova/virt/