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

Stefan Priebe s.priebe at profihost.ag
Sat Dec 15 13:22:52 CET 2012


Hi Alexandre,

great catch. How did you find it? Will integrate it into our own 3.6 kernel.

Stefan

Am 15.12.2012 12:03, schrieb Alexandre DERUMIER:
> I'm not sure, but the commit
> virtio-scsi: support online resizing of disks
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=865b58c05b841964f48f574c2027311bd04db8a1
>
> seem to be release after kernel 3.6, so maybe it's working with kernel 3.7.
>
> what kernel version do you use in your guest ?
>
>
> ----- Mail original -----
>
> De: "Stefan Priebe" <s.priebe at profihost.ag>
> À: "Alexandre DERUMIER" <aderumier at odiso.com>
> Cc: pve-devel at pve.proxmox.com
> Envoyé: Vendredi 14 Décembre 2012 21:12:16
> Objet: Re: [pve-devel] pve-manager : add hd resize feature
>
> Hi Alexandre,
>
> it seems i've to trigger a scsi rescan
>
> /sys/devices/pci0000:00/0000:00:05.0/virtio0/host2/target2:0:0/2:0:0:1/rescan
>
> sad that this is really needed for virtio-scsi
>
> Greets,
> Stefan
>
> Am 14.12.2012 20:54, schrieb Stefan Priebe:
>> Hi Alexandre,
>>
>> you're correct your code is fine. I'm using virtio-scsi.
>>
>> Even when i manually enter qm monitor and do:
>> block_resize drive-scsi1 98G
>>
>> the guest does not notice anything... Guest is running 3.6.10 vanilla
>> kernel.
>>
>> So it must be a limitation of virtio-scsi or a bug in qemu.
>>
>> Dietmar any ideas?
>>
>> Greets,
>> Stefan
>>
>>
>> Am 14.12.2012 18:29, schrieb Alexandre DERUMIER:
>>>>> The problem is the RBD Plugin right now it doesn't returns undef in
>>>>> current git version
>>> this is the right way.
>>>
>>> It's return 1 if the vm running, we don't need to run "rbd" command if
>>> the vm is running,
>>> using vm_mon_cmd is enough to resize volume.
>>> (this is the qemu rbd block driver which resize the volume and then
>>> advertise the guest that the size have changed)
>>>
>>>
>>> Just an idea, do you use rbd image format v1 or v2 ? (I only tested it
>>> with format v1)
>>>
>>>
>>> ----- Mail original -----
>>>
>>> De: "Stefan Priebe - Profihost AG" <s.priebe at profihost.ag>
>>> À: "Alexandre DERUMIER" <aderumier at odiso.com>
>>> Cc: pve-devel at pve.proxmox.com
>>> Envoyé: Vendredi 14 Décembre 2012 17:52:16
>>> Objet: Re: [pve-devel] pve-manager : add hd resize feature
>>>
>>> The problem is the RBD Plugin right now it doesn't returns undef in
>>> current git version
>>>
>>> Greeks Stefan
>>>
>>> Am 14.12.2012 um 17:25 schrieb Alexandre DERUMIER <aderumier at odiso.com>:
>>>
>>>> gui patches just implement api call to "qm resize ...."
>>>> so it should work since some week with qm command.
>>>>
>>>>
>>>>
>>>>
>>>> sub volume_resize {
>>>> my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
>>>>
>>>>>> if running, we return 1 to qemu_block_resize (so it'll use
>>>>>> vm_mon_cmd qm resize)
>>>> return 1 if $running;
>>>>
>>>>
>>>>>> if not running, we resize offline with rbd command
>>>>
>>>> my $cmd = &$rbd_cmd($scfg, $storeid, 'resize', '--size',
>>>> ($size/1024/1024), $volname);
>>>> run_command($cmd, errmsg => "rbd resize $volname' error", errfunc =>
>>>> sub {});
>>>> return undef;
>>>> }
>>>>
>>>>
>>>> do you use virtio or virtio-scsi ?
>>>>
>>>> It's work fine for me with virtio.
>>>>
>>>>
>>>> ----- Mail original -----
>>>>
>>>> De: "Stefan Priebe - Profihost AG" <s.priebe at profihost.ag>
>>>> À: "Alexandre DERUMIER" <aderumier at odiso.com>
>>>> Cc: pve-devel at pve.proxmox.com
>>>> Envoyé: Vendredi 14 Décembre 2012 15:55:31
>>>> Objet: Re: [pve-devel] pve-manager : add hd resize feature
>>>>
>>>> Hi Alexandre,
>>>>
>>>> strange. It does not work to me. I've only applied these two patches -
>>>> do i need more patches?
>>>>
>>>> I've lost the overview of all your patches.
>>>>
>>>> Stefan
>>>>
>>>> Am 14.12.2012 15:53, schrieb Alexandre DERUMIER:
>>>>> I have also retested with rbd device on virtio disk (kernel 3.6),
>>>>> and it's working fine too ...
>>>>>
>>>>> ----- 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