qvm-block extends volumes to NEW_SIZE

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-09-02 19:55:54 +02:00
parent be48d48e56
commit dcfc47fefe
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE
2 changed files with 4 additions and 4 deletions

View File

@ -88,9 +88,9 @@ aliases: d, dt
extend extend
^^^^^^ ^^^^^^
| :command:`qvm-block extend` [-h] [--verbose] [--quiet] *POOL_NAME:VOLUME_ID* *SIZE* | :command:`qvm-block extend` [-h] [--verbose] [--quiet] *POOL_NAME:VOLUME_ID* *NEW_SIZE*
Extends the volume with *POOL_NAME:VOLUME_ID* BY *SIZE* bytes Extend the volume with *POOL_NAME:VOLUME_ID* TO *NEW_SIZE*
revert revert
^^^^^^ ^^^^^^

View File

@ -129,12 +129,12 @@ def rename_volume(old_name, new_name):
def extend_volume(args): def extend_volume(args):
''' Extends an existing lvm volume. Note this works on any lvm volume not ''' Extends an existing lvm volume. Note this works on any lvm volume not
only thin volumes. only on thin volumes.
''' '''
vid = args.name vid = args.name
size = int(args.size) / (1000 * 1000) size = int(args.size) / (1000 * 1000)
log.debug("Extending LVM %s to %s", vid, size) log.debug("Extending LVM %s to %s", vid, size)
cmd = ["lvextend", "-L+%s" % size, vid] cmd = ["lvextend", "-L%s" % size, vid]
log.debug(cmd) log.debug(cmd)
retcode = subprocess.call(cmd) retcode = subprocess.call(cmd)
if retcode != 0: if retcode != 0: