diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-12-07 10:31:36 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-12-07 10:31:36 +0200 |
commit | a4b78a473202a50cfde613493214e7f6b808edb8 (patch) | |
tree | c736be2e11da2feb229e33759c63222cd77c1246 /remove-vm | |
parent | e4581bf39cb04bd0519e4a515395d41e766a3bd0 (diff) | |
download | ansibleness-a4b78a473202a50cfde613493214e7f6b808edb8.tar.gz |
Change: if lvremove fails, try undoing kpartx
Diffstat (limited to 'remove-vm')
-rwxr-xr-x | remove-vm | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -25,11 +25,16 @@ remove_vm() run_virsh undefine "$name" fi + # Remove the LV, if it exists. lvpath="/dev/$vg/$name" if [ -e "$lvpath" ] then sudo lvremove --force "$lvpath" + else + # In case the LV was kpartx'd, undo that + sudo kpartx -dsv "$lvpath" + sudo lvremove --force "$lvpath" fi # Remove the host from /etc/hosts, if there. |