Discussion:
[pve-devel] online resize of virtio-blk?
Stefan Priebe
2012-07-28 19:58:42 UTC
Permalink
Hello list,

is online resizing of virtio blk devices supported? It seems Redhat
itself supports it:
https://bugzilla.redhat.com/show_bug.cgi?id=648594

I've resized the LVM block device outside of the VM but inside the VM
i've no idea how to get the new size.

Stefan
Alexandre DERUMIER
2012-07-29 06:31:16 UTC
Permalink
i'm not sure it's possible with virtio-blk.

virtio-scsi seem to support it in qemu git.

I'll make some tests today with .raw files to see what is possible.



BTW, I would like to implement resize of volume in proxmox for the future, could you describe how to resize an lvm device ?


----- Mail original -----

De: "Stefan Priebe" <***@profihost.ag>
À: pve-***@pve.proxmox.com
Envoyé: Samedi 28 Juillet 2012 21:58:42
Objet: [pve-devel] online resize of virtio-blk?

Hello list,

is online resizing of virtio blk devices supported? It seems Redhat
itself supports it:
https://bugzilla.redhat.com/show_bug.cgi?id=648594

I've resized the LVM block device outside of the VM but inside the VM
i've no idea how to get the new size.

Stefan
_______________________________________________
pve-devel mailing list
pve-***@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
--
Alexandre D e rumier

Ingénieur Systèmes et Réseaux


Fixe : 03 20 68 88 85

Fax : 03 20 68 90 88


45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
Stefan Priebe
2012-07-29 09:39:56 UTC
Permalink
Hello,

it works perfectly this way:

lvextend -L ${newsize}G /dev/pve/vm-100-disk-1

~# qm monitor 100
Entering Qemu Monitor for VM 100 - type 'help' for help
qm> block_resize drive-virtio0 30G
qm> quit

in VM:
dmesg shows:
[53925.713083] virtio_blk virtio0: new size: 62914560 512-byte logical
blocks (32.2 GB/30.0 GiB)

Stefan
Post by Alexandre DERUMIER
i'm not sure it's possible with virtio-blk.
virtio-scsi seem to support it in qemu git.
I'll make some tests today with .raw files to see what is possible.
BTW, I would like to implement resize of volume in proxmox for the future, could you describe how to resize an lvm device ?
----- Mail original -----
Envoyé: Samedi 28 Juillet 2012 21:58:42
Objet: [pve-devel] online resize of virtio-blk?
Hello list,
is online resizing of virtio blk devices supported? It seems Redhat
https://bugzilla.redhat.com/show_bug.cgi?id=648594
I've resized the LVM block device outside of the VM but inside the VM
i've no idea how to get the new size.
Stefan
_______________________________________________
pve-devel mailing list
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Alexandre DERUMIER
2012-07-29 06:57:18 UTC
Permalink
I've made some, it seem only possible with files (.raw, .qcow2).

using the monitor command "block_resize".

then it's resize the file online, and notify the virtio-blk driver that size is updated.


I don't know if we can launch some kind of manual rescan with virtio-blk. (with scsi and virtio-scsi, we can use sysfs to rescan the scsi layer)

about the originals commit of block_resize:
http://comments.gmane.org/gmane.comp.emulators.qemu/91126

"[PATCH 3/3] virtio-blk: tell the guest about size changes

Raise a config change interrupt when the size changed. This allows
virtio-blk guest drivers to read-read the information from the
config space once it got the config chaged interrupt."

so the question is how to generate a manual config change interrupt ?




----- Mail original -----

De: "Alexandre DERUMIER" <***@odiso.com>
À: "Stefan Priebe" <***@profihost.ag>
Cc: pve-***@pve.proxmox.com
Envoyé: Dimanche 29 Juillet 2012 08:31:16
Objet: Re: [pve-devel] online resize of virtio-blk?

i'm not sure it's possible with virtio-blk.

virtio-scsi seem to support it in qemu git.

I'll make some tests today with .raw files to see what is possible.



BTW, I would like to implement resize of volume in proxmox for the future, could you describe how to resize an lvm device ?


----- Mail original -----

De: "Stefan Priebe" <***@profihost.ag>
À: pve-***@pve.proxmox.com
Envoyé: Samedi 28 Juillet 2012 21:58:42
Objet: [pve-devel] online resize of virtio-blk?

Hello list,

is online resizing of virtio blk devices supported? It seems Redhat
itself supports it:
https://bugzilla.redhat.com/show_bug.cgi?id=648594

I've resized the LVM block device outside of the VM but inside the VM
i've no idea how to get the new size.

Stefan
_______________________________________________
pve-devel mailing list
pve-***@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
--
Alexandre D e rumier

Ingénieur Systèmes et Réseaux


Fixe : 03 20 68 88 85

Fax : 03 20 68 90 88


45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris

_______________________________________________
pve-devel mailing list
pve-***@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
--
Alexandre D e rumier

Ingénieur Systèmes et Réseaux


Fixe : 03 20 68 88 85

Fax : 03 20 68 90 88


45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
Stefan Priebe
2012-07-29 07:28:43 UTC
Permalink
What happens if we send the same monitor command in this case? How to send a block_resize command?

Will test and answer all other mails
tonight.

Stefan
Post by Alexandre DERUMIER
I've made some, it seem only possible with files (.raw, .qcow2).
using the monitor command "block_resize".
then it's resize the file online, and notify the virtio-blk driver that size is updated.
I don't know if we can launch some kind of manual rescan with virtio-blk. (with scsi and virtio-scsi, we can use sysfs to rescan the scsi layer)
http://comments.gmane.org/gmane.comp.emulators.qemu/91126
"[PATCH 3/3] virtio-blk: tell the guest about size changes
Raise a config change interrupt when the size changed. This allows
virtio-blk guest drivers to read-read the information from the
config space once it got the config chaged interrupt."
so the question is how to generate a manual config change interrupt ?
----- Mail original -----
Envoyé: Dimanche 29 Juillet 2012 08:31:16
Objet: Re: [pve-devel] online resize of virtio-blk?
i'm not sure it's possible with virtio-blk.
virtio-scsi seem to support it in qemu git.
I'll make some tests today with .raw files to see what is possible.
BTW, I would like to implement resize of volume in proxmox for the future, could you describe how to resize an lvm device ?
----- Mail original -----
Envoyé: Samedi 28 Juillet 2012 21:58:42
Objet: [pve-devel] online resize of virtio-blk?
Hello list,
is online resizing of virtio blk devices supported? It seems Redhat
https://bugzilla.redhat.com/show_bug.cgi?id=648594
I've resized the LVM block device outside of the VM but inside the VM
i've no idea how to get the new size.
Stefan
_______________________________________________
pve-devel mailing list
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
--
Alexandre D e rumier
Ingénieur Systèmes et Réseaux
Fixe : 03 20 68 88 85
Fax : 03 20 68 90 88
45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
_______________________________________________
pve-devel mailing list
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
--
Alexandre D e rumier
Ingénieur Systèmes et Réseaux
Fixe : 03 20 68 88 85
Fax : 03 20 68 90 88
45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
Alexandre DERUMIER
2012-07-29 07:01:33 UTC
Permalink
just found this on ceph tracker; http://tracker.newdream.net/issues/2232

I tested this on Friday, and qemu rereads the size (at least when using virtio) when the guest requests it (i.e. echo 1 | sudo tee /sys/bus/pci/rescan).




maybe could you try this ?

----- Mail original -----

De: "Alexandre DERUMIER" <***@odiso.com>
À: "Stefan Priebe" <***@profihost.ag>
Cc: pve-***@pve.proxmox.com
Envoyé: Dimanche 29 Juillet 2012 08:57:18
Objet: Re: [pve-devel] online resize of virtio-blk?

I've made some, it seem only possible with files (.raw, .qcow2).

using the monitor command "block_resize".

then it's resize the file online, and notify the virtio-blk driver that size is updated.


I don't know if we can launch some kind of manual rescan with virtio-blk. (with scsi and virtio-scsi, we can use sysfs to rescan the scsi layer)

about the originals commit of block_resize:
http://comments.gmane.org/gmane.comp.emulators.qemu/91126

"[PATCH 3/3] virtio-blk: tell the guest about size changes

Raise a config change interrupt when the size changed. This allows
virtio-blk guest drivers to read-read the information from the
config space once it got the config chaged interrupt."

so the question is how to generate a manual config change interrupt ?




----- Mail original -----

De: "Alexandre DERUMIER" <***@odiso.com>
À: "Stefan Priebe" <***@profihost.ag>
Cc: pve-***@pve.proxmox.com
Envoyé: Dimanche 29 Juillet 2012 08:31:16
Objet: Re: [pve-devel] online resize of virtio-blk?

i'm not sure it's possible with virtio-blk.

virtio-scsi seem to support it in qemu git.

I'll make some tests today with .raw files to see what is possible.



BTW, I would like to implement resize of volume in proxmox for the future, could you describe how to resize an lvm device ?


----- Mail original -----

De: "Stefan Priebe" <***@profihost.ag>
À: pve-***@pve.proxmox.com
Envoyé: Samedi 28 Juillet 2012 21:58:42
Objet: [pve-devel] online resize of virtio-blk?

Hello list,

is online resizing of virtio blk devices supported? It seems Redhat
itself supports it:
https://bugzilla.redhat.com/show_bug.cgi?id=648594

I've resized the LVM block device outside of the VM but inside the VM
i've no idea how to get the new size.

Stefan
_______________________________________________
pve-devel mailing list
pve-***@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
--
Alexandre D e rumier

Ingénieur SystÚmes et Réseaux


Fixe : 03 20 68 88 85

Fax : 03 20 68 90 88


45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris

_______________________________________________
pve-devel mailing list
pve-***@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
--
Alexandre D e rumier

Ingénieur SystÚmes et Réseaux


Fixe : 03 20 68 88 85

Fax : 03 20 68 90 88


45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
_______________________________________________
pve-devel mailing list
pve-***@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
Alexandre D e rumier
Ingénieur SystÚmes et Réseaux

Fixe : 03 20 68 88 85

Fax : 03 20 68 90 88

45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
Stefan Priebe
2012-07-29 09:33:08 UTC
Permalink
Post by Alexandre DERUMIER
just found this on ceph tracker;
http://tracker.newdream.net/issues/2232
I tested this on Friday, and qemu rereads the size (at least when using
virtio) when the guest requests it (i.e. echo 1 | sudo tee
/sys/bus/pci/rescan).
doesn't work for me:

~# blockdev --getsize64 /dev/vda
21474836480

~# echo 1 > /sys/bus/pci/rescan

~# blockdev --getsize64 /dev/vda
21474836480

But lvs show the correct size of 30GB:
~# lvs
vm-100-disk-1 pve -wi-ao-- 30.00g

Stefan
Alexandre DERUMIER
2012-07-29 09:57:01 UTC
Permalink
oh great to know :)


what happen if block_resize drive-virtio0 XXG is different that real lvm disk size ?



----- Mail original -----

De: "Stefan Priebe" <***@profihost.ag>
À: "Alexandre DERUMIER" <***@odiso.com>
Cc: pve-***@pve.proxmox.com
Envoyé: Dimanche 29 Juillet 2012 11:39:56
Objet: Re: [pve-devel] online resize of virtio-blk?

Hello,

it works perfectly this way:

lvextend -L ${newsize}G /dev/pve/vm-100-disk-1

~# qm monitor 100
Entering Qemu Monitor for VM 100 - type 'help' for help
qm> block_resize drive-virtio0 30G
qm> quit

in VM:
dmesg shows:
[53925.713083] virtio_blk virtio0: new size: 62914560 512-byte logical
blocks (32.2 GB/30.0 GiB)

Stefan
Post by Alexandre DERUMIER
i'm not sure it's possible with virtio-blk.
virtio-scsi seem to support it in qemu git.
I'll make some tests today with .raw files to see what is possible.
BTW, I would like to implement resize of volume in proxmox for the future, could you describe how to resize an lvm device ?
----- Mail original -----
Envoyé: Samedi 28 Juillet 2012 21:58:42
Objet: [pve-devel] online resize of virtio-blk?
Hello list,
is online resizing of virtio blk devices supported? It seems Redhat
https://bugzilla.redhat.com/show_bug.cgi?id=648594
I've resized the LVM block device outside of the VM but inside the VM
i've no idea how to get the new size.
Stefan
_______________________________________________
pve-devel mailing list
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
Alexandre D e rumier
Ingénieur SystÚmes et Réseaux

Fixe : 03 20 68 88 85

Fax : 03 20 68 90 88

45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
Stefan Priebe
2012-07-29 10:07:29 UTC
Permalink
Value too big:
qm> block_resize drive-virtio0 45G
An undefined error has occurred

But too small works...
qm> block_resize drive-virtio0 15G
An undefined error has occurred

Stefan
Post by Alexandre DERUMIER
oh great to know :)
what happen if block_resize drive-virtio0 XXG is different that real
lvm disk size ?
------------------------------------------------------------------------
*Envoyé: *Dimanche 29 Juillet 2012 11:39:56
*Objet: *Re: [pve-devel] online resize of virtio-blk?
Hello,
lvextend -L ${newsize}G /dev/pve/vm-100-disk-1
~# qm monitor 100
Entering Qemu Monitor for VM 100 - type 'help' for help
qm> block_resize drive-virtio0 30G
qm> quit
[53925.713083] virtio_blk virtio0: new size: 62914560 512-byte logical
blocks (32.2 GB/30.0 GiB)
Stefan
Post by Alexandre DERUMIER
i'm not sure it's possible with virtio-blk.
virtio-scsi seem to support it in qemu git.
I'll make some tests today with .raw files to see what is possible.
BTW, I would like to implement resize of volume in proxmox for the
future, could you describe how to resize an lvm device ?
Post by Alexandre DERUMIER
----- Mail original -----
Envoyé: Samedi 28 Juillet 2012 21:58:42
Objet: [pve-devel] online resize of virtio-blk?
Hello list,
is online resizing of virtio blk devices supported? It seems Redhat
https://bugzilla.redhat.com/show_bug.cgi?id=648594
I've resized the LVM block device outside of the VM but inside the VM
i've no idea how to get the new size.
Stefan
_______________________________________________
pve-devel mailing list
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
*Alexandre **D**e**rumier*
*Ingénieur Systèmes et Réseaux*
*Fixe : *03 20 68 88 85
*Fax : *03 20 68 90 88
45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
Stefan Priebe
2012-07-29 10:09:56 UTC
Permalink
this works fine, wenn the disk is not mounted. if it is mounted you need
this kernel patch in guest system:

http://markmail.org/thread/brnvz2kzjyqg4kay#query:+page:1+mid:brnvz2kzjyqg4kay+state:results

Otherwise fdisk and blockdev still thinks the disk is smaller.

Stefan
Post by Alexandre DERUMIER
oh great to know :)
what happen if block_resize drive-virtio0 XXG is different that real
lvm disk size ?
------------------------------------------------------------------------
*Envoyé: *Dimanche 29 Juillet 2012 11:39:56
*Objet: *Re: [pve-devel] online resize of virtio-blk?
Hello,
lvextend -L ${newsize}G /dev/pve/vm-100-disk-1
~# qm monitor 100
Entering Qemu Monitor for VM 100 - type 'help' for help
qm> block_resize drive-virtio0 30G
qm> quit
[53925.713083] virtio_blk virtio0: new size: 62914560 512-byte logical
blocks (32.2 GB/30.0 GiB)
Stefan
Post by Alexandre DERUMIER
i'm not sure it's possible with virtio-blk.
virtio-scsi seem to support it in qemu git.
I'll make some tests today with .raw files to see what is possible.
BTW, I would like to implement resize of volume in proxmox for the
future, could you describe how to resize an lvm device ?
Post by Alexandre DERUMIER
----- Mail original -----
Envoyé: Samedi 28 Juillet 2012 21:58:42
Objet: [pve-devel] online resize of virtio-blk?
Hello list,
is online resizing of virtio blk devices supported? It seems Redhat
https://bugzilla.redhat.com/show_bug.cgi?id=648594
I've resized the LVM block device outside of the VM but inside the VM
i've no idea how to get the new size.
Stefan
_______________________________________________
pve-devel mailing list
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
*Alexandre **D**e**rumier*
*Ingénieur Systèmes et Réseaux*
*Fixe : *03 20 68 88 85
*Fax : *03 20 68 90 88
45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
Alexandre DERUMIER
2012-07-29 12:29:50 UTC
Permalink
oh, thanks about that.


I have done test in the past, and I had always problem.


Do you know in which kernel version this patch is applied ?

----- Mail original -----

De: "Stefan Priebe" <***@profihost.ag>
À: "Alexandre DERUMIER" <***@odiso.com>
Cc: pve-***@pve.proxmox.com
Envoyé: Dimanche 29 Juillet 2012 12:09:56
Objet: Re: [pve-devel] online resize of virtio-blk?

this works fine, wenn the disk is not mounted. if it is mounted you need
this kernel patch in guest system:

http://markmail.org/thread/brnvz2kzjyqg4kay#query:+page:1+mid:brnvz2kzjyqg4kay+state:results

Otherwise fdisk and blockdev still thinks the disk is smaller.

Stefan
Post by Alexandre DERUMIER
oh great to know :)
what happen if block_resize drive-virtio0 XXG is different that real
lvm disk size ?
------------------------------------------------------------------------
*Envoyé: *Dimanche 29 Juillet 2012 11:39:56
*Objet: *Re: [pve-devel] online resize of virtio-blk?
Hello,
lvextend -L ${newsize}G /dev/pve/vm-100-disk-1
~# qm monitor 100
Entering Qemu Monitor for VM 100 - type 'help' for help
qm> block_resize drive-virtio0 30G
qm> quit
[53925.713083] virtio_blk virtio0: new size: 62914560 512-byte logical
blocks (32.2 GB/30.0 GiB)
Stefan
Post by Alexandre DERUMIER
i'm not sure it's possible with virtio-blk.
virtio-scsi seem to support it in qemu git.
I'll make some tests today with .raw files to see what is possible.
BTW, I would like to implement resize of volume in proxmox for the
future, could you describe how to resize an lvm device ?
Post by Alexandre DERUMIER
----- Mail original -----
Envoyé: Samedi 28 Juillet 2012 21:58:42
Objet: [pve-devel] online resize of virtio-blk?
Hello list,
is online resizing of virtio blk devices supported? It seems Redhat
https://bugzilla.redhat.com/show_bug.cgi?id=648594
I've resized the LVM block device outside of the VM but inside the VM
i've no idea how to get the new size.
Stefan
_______________________________________________
pve-devel mailing list
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
*Alexandre **D**e**rumier*
*Ingénieur SystÚmes et Réseaux*
*Fixe : *03 20 68 88 85
*Fax : *03 20 68 90 88
45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
--
Alexandre D e rumier
Ingénieur SystÚmes et Réseaux

Fixe : 03 20 68 88 85

Fax : 03 20 68 90 88

45 Bvd du Général Leclerc 59100 Roubaix
12 rue Marivaux 75002 Paris
Stefan Priebe
2012-07-29 19:29:51 UTC
Permalink
Post by Alexandre DERUMIER
oh, thanks about that.
I have done test in the past, and I had always problem.
Do you know in which kernel version this patch is applied ?
no but from the release dates i would say 3.4 or 3.5.

Stefan

Loading...