How to fix the error of not being able to resize volume?

In Train version of OpenStack an error is possible, when the size of volume connected to instance is resized, its size inside the system does not change. At the same time, the logs of the nova-compute service on the compute nodes may contain errors like this:

root@cn-ce352b:~# tail -f /var/log/nova/nova-compute.log
2020-07-27 22:46:19.862 30072 ERROR oslo_messaging.rpc.server   File "/usr/lib/python3/dist-packages/os_brick/executor.py", line 52, in _execute
2020-07-27 22:46:19.862 30072 ERROR oslo_messaging.rpc.server     result = self.__execute(*args, **kwargs)
2020-07-27 22:46:19.862 30072 ERROR oslo_messaging.rpc.server   File "/usr/lib/python3/dist-packages/os_brick/privileged/rootwrap.py", line 187, in execute
2020-07-27 22:46:19.862 30072 ERROR oslo_messaging.rpc.server     cmd=sanitized_cmd, description=six.text_type(e))
2020-07-27 22:46:19.862 30072 ERROR oslo_messaging.rpc.server oslo_concurrency.processutils.ProcessExecutionError: [Errno 2] No such file or directory: 'sg_scan'
2020-07-27 22:46:19.862 30072 ERROR oslo_messaging.rpc.server Command: sg_scan /dev/disk/by-path/ip-10.40.11.5:3260-iscsi-iqn.2010-10.org.openstack:volume-c0d63818-438b-4a93-a1c9-18bfab98cd6d-lun-1
2020-07-27 22:46:19.862 30072 ERROR oslo_messaging.rpc.server Exit code: -
2020-07-27 22:46:19.862 30072 ERROR oslo_messaging.rpc.server Stdout: None
2020-07-27 22:46:19.862 30072 ERROR oslo_messaging.rpc.server Stderr: None
2020-07-27 22:46:19.862 30072 ERROR oslo_messaging.rpc.server

To fix the error, you need to:

  1. Make sure that sg3-utils package is installed on compute nodes.

  2. If the package is missing, you must install it on all compute nodes where you plan to change the size of the attached volume:

    apt install sg3-utils
    
  3. Then restart the service nova-compute:

    systemctl restart nova-compute