[pve-devel] pve-manager : add hd resize feature

Stefan Priebe - Profihost AG s.priebe at profihost.ag
Fri Dec 14 16:41:09 CET 2012


Hi Alexandre,

right now RBDPlugin.pm returns undef:

sub volume_resize {
     my ($class, $scfg, $storeid, $volname, $size, $running) = @_;

     return 1 if $running;

     my $cmd = &$rbd_cmd($scfg, $storeid, 'resize', '--size', 
($size/1024/1024), $volname);
     run_command($cmd, errmsg => "rbd resize $volname' error", errfunc 
=> sub {});
     return undef;
}

Greets,
Stefan

Am 14.12.2012 10:10, schrieb Alexandre DERUMIER:
>>> this works fine but the new size isn't exposed / send to guest. The new
>>> size should be viewable in guest when kernel supports this.
>
> This is strange because I have tested it, and it's was working fine. (files and nexenta)
> (with linux guest kernel >= 3.6 or windows).
>
> which storage type do you try ? (rbd ?)
>
>>> So shouldn't we add this:
>>> my $input = "block_resize drive-scsi1 ${size}G";
>>> PVE::QemuServer::vm_human_monitor_command ( $vmid, $input );
>
> It's already done
>
> QemuServer.pm
>
> sub qemu_block_resize {
>      my ($vmid, $deviceid, $storecfg, $volid, $size) = @_;
>
>      my $running = PVE::QemuServer::check_running($vmid);
>
>      return if !PVE::Storage::volume_resize($storecfg, $volid, $size, $running);
>
>      return if !$running;
>
>      vm_mon_cmd($vmid, "block_resize", device => $deviceid, size => int($size));
>
> }
>
>
> Depend of the storage plugin, if the storage plugin return 1, we launch vm_mon_cmd($vmid, "block_resize", device => $deviceid, size => int($size));
>
> (this is because some storage plugin need only the qmp command, some other not).
>
> So maybe this is a bug for a specific storage plugin.
>
>
> ----- Mail original -----
>
> De: "Stefan Priebe" <s.priebe at profihost.ag>
> À: "Alexandre Derumier" <aderumier at odiso.com>
> Cc: pve-devel at pve.proxmox.com
> Envoyé: Jeudi 13 Décembre 2012 22:30:07
> Objet: Re: [pve-devel] pve-manager : add hd resize feature
>
> Hi Alexandre,
>
> this works fine but the new size isn't exposed / send to guest. The new
> size should be viewable in guest when kernel supports this.
>
> So shouldn't we add this:
> my $input = "block_resize drive-scsi1 ${size}G";
> PVE::QemuServer::vm_human_monitor_command ( $vmid, $input );
>
> So the guest already know about new size if guest kernel supports it.
>
> Greets,
> Stefan
>
> Am 13.12.2012 15:41, schrieb Alexandre Derumier:
>> Please review, but I think it's clean.
>>
>> _______________________________________________
>> pve-devel mailing list
>> pve-devel at pve.proxmox.com
>> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>>



More information about the pve-devel mailing list