@ax.kashirin, Have you test your code if the volume is attached on a vm(status is in-use)? I pick your code and seems not work on that situation.
@ax.kashirin, Have you test your code if the volume is attached on a vm(status is in-use)? I pick your code and seems not work on that situation.