qm: resize implemented (copy of ct resize)
This commit is contained in:
parent
4dbb21f1c1
commit
c7c9bf4800
|
@ -26,6 +26,13 @@ def cli_qm
|
||||||
STDERR.puts "! #{$?.exitstatus}" unless Proxmox::Qemu.find!( name_or_id).exec *command
|
STDERR.puts "! #{$?.exitstatus}" unless Proxmox::Qemu.find!( name_or_id).exec *command
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ct_cli.cmd( :resize, 'Resize a disk', &lambda {|name_or_id, disk, size|
|
||||||
|
connect
|
||||||
|
qm = Proxmox::Qemu.find! name_or_id
|
||||||
|
task = qm.resize disk, size
|
||||||
|
wait task, text: "Resizing #{qm.sid} #{disk} to #{size}"
|
||||||
|
})
|
||||||
|
|
||||||
qm.cmd 'help', '', aliases: ['-h', '--help'], &lambda {|*args| help qm, *args }
|
qm.cmd 'help', '', aliases: ['-h', '--help'], &lambda {|*args| help qm, *args }
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -404,6 +404,11 @@ module Proxmox
|
||||||
def exec *args
|
def exec *args
|
||||||
node.exec 'qm', 'guest', 'exec', vmid, '--', *args
|
node.exec 'qm', 'guest', 'exec', vmid, '--', *args
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def resize disk, size
|
||||||
|
upid = rest_put "#{@rest_prefix}/resize", disk: disk, size: size
|
||||||
|
Task.send :__new__, node: @node, host: self, upid: upid
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class LXC < Hosted
|
class LXC < Hosted
|
||||||
|
|
Loading…
Reference in a new issue