mirror of
https://github.com/ceph/ceph
synced 2025-01-20 01:51:34 +00:00
ceph-volume: adds an api.lvm.remove_pv method
Used to remove physical volumes Signed-off-by: Andrew Schoen <aschoen@redhat.com>
This commit is contained in:
parent
10a349742c
commit
0811c02b11
@ -233,6 +233,28 @@ def remove_vg(vg_name):
|
||||
return True
|
||||
|
||||
|
||||
def remove_pv(pv_name):
|
||||
"""
|
||||
Removes a physical volume.
|
||||
|
||||
Will return True if the pv is successfully removed or
|
||||
raises a RuntimeError if the removal fails.
|
||||
"""
|
||||
stdout, stderr, returncode = process.call(
|
||||
[
|
||||
'pvremove',
|
||||
'-v', # verbose
|
||||
'-f', # force it
|
||||
pv_name
|
||||
],
|
||||
show_command=True,
|
||||
terminal_verbose=True,
|
||||
)
|
||||
if returncode != 0:
|
||||
raise RuntimeError("Unable to remove vg %s".format(pv_name))
|
||||
return True
|
||||
|
||||
|
||||
def remove_lv(path):
|
||||
"""
|
||||
Removes a logical volume given it's absolute path.
|
||||
|
Loading…
Reference in New Issue
Block a user