<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hi Daniel</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>As the moderns Windows systems have the options of
grow or shrink the partitions of his HDDs online, add such features to the PVE
GUI will be very pleasant.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>And if is possible also add the a option of "resize
to the max allowed" (the space available in his Volume group) , will be
fantastic.</FONT></DIV>
<DIV><FONT size=2 face=Arial> </DIV></FONT>
<DIV><FONT size=2 face=Arial>Best regards</FONT></DIV>
<DIV><FONT size=2 face=Arial>Cesar</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=danhunsaker@gmail.com href="mailto:danhunsaker@gmail.com">Daniel
Hunsaker</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=aderumier@odiso.com
href="mailto:aderumier@odiso.com">Alexandre DERUMIER</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=pve-devel@pve.proxmox.com
href="mailto:pve-devel@pve.proxmox.com">pve-devel@pve.proxmox.com</A> ; <A
title=brain@click.com.py href="mailto:brain@click.com.py">Cesar Peschiera</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, November 28, 2014 3:55
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [pve-devel] Error between
PVE and LVM</DIV>
<DIV><BR></DIV>The only difference between lvresize and lvextend is that
lvresize supports shrinking the volume as well as growing it. My comments
aren't questions so much as observations on a patch series I'm planning to
create and submit that will allow shrinking volumes as well as expanding them.
Probably roll the max-free option in there as well if it hasn't been added
already by then, though I wonder at the utility of such an operation, since
you could only use it on one lv per vg.<BR><BR>
<DIV class=gmail_quote>On Thu, Nov 27, 2014, 23:49 Alexandre DERUMIER
<<A href="mailto:aderumier@odiso.com">aderumier@odiso.com</A>>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>Sorry, but I'm a bit lost in all the
discussion.<BR><BR>are your questions (both daniel and cesar) about
shrinking ? or extend ?<BR><BR>(I don't have used lvm since a long
time, don't known the difference between lvresize and
lvextend).<BR><BR>@cesar, I don't understand why since the begin of this
discus, you resize manually the lvm disk.<BR>(If the need is to do it
command line, use qm resize, it'll extend the lvm volume and tell to qemu
the new size)<BR><BR><BR><BR><BR>----- Mail original -----<BR><BR>De:
"Daniel Hunsaker" <<A href="mailto:danhunsaker@gmail.com"
target=_blank>danhunsaker@gmail.com</A>><BR>À: "Alexandre DERUMIER"
<<A href="mailto:aderumier@odiso.com"
target=_blank>aderumier@odiso.com</A>>, "Cesar Peschiera" <<A
href="mailto:brain@click.com.py"
target=_blank>brain@click.com.py</A>><BR>Cc: <A
href="mailto:pve-devel@pve.proxmox.com"
target=_blank>pve-devel@pve.proxmox.com</A><BR>Envoyé: Vendredi 28 Novembre
2014 06:32:15<BR>Objet: Re: [pve-devel] Error between PVE and LVM<BR><BR>Ah,
good, it does support +size. In that case, simply swapping `lvresize` into
the code in place of `lvextend` (along with properly handling -size to
convert it to an absolute size for the command) would add shrinking support
to LVM storage. Just need to further explore the other storage plugins'
resize options to get shrinking for them as well. Makes the patches a bit
simpler.<BR><BR>And yes, I always forget about `qm`. It's quite a bit
simpler than `pvesh`.<BR><BR><BR>On Thu, Nov 27, 2014, 22:11 Alexandre
DERUMIER < <A href="mailto:aderumier@odiso.com"
target=_blank>aderumier@odiso.com</A> > wrote:<BR><BR><BR>>>But for
this moment, i have two questions:<BR>>>1) Do I have any simpler
option to grow my LV(that is the HDD of the VM)
by<BR>>>CLI?<BR>>>2) If the answer is correct, what exactly
should i execute?<BR><BR>all the gui feature are available with cli, with
"qm" command.<BR><BR><BR><BR>#qm resize <vmid> <disk>
<size><BR><BR>#man qm<BR>qm resize <vmid> <disk>
<size> [OPTIONS]<BR><BR>Extend volume size.<BR><BR><vmid>
integer (1 - N)<BR><BR>The (unique) ID of the VM.<BR><BR><disk> (ide0
| ide1 | ide2 | ide3 | sata0 | sata1 | sata2 | sata3 |<BR>sata4 | sata5 |
scsi0 | scsi1 | scsi10 | scsi11 | scsi12 |<BR>scsi13 | scsi2 | scsi3 | scsi4
| scsi5 | scsi6 | scsi7 | scsi8<BR>| scsi9 | virtio0 | virtio1 | virtio10 |
virtio11 | virtio12 |<BR>virtio13 | virtio14 | virtio15 | virtio2 | virtio3
| virtio4 |<BR>virtio5 | virtio6 | virtio7 | virtio8 | virtio9)<BR><BR>The
disk you want to resize.<BR><BR><size>
\+?\d+(\.\d+)?[KMGT]?<BR><BR>The new size. With the '+' sign the value is
added to the<BR>actual size of the volume and without it, the value is
taken<BR>as an absolute one. Shrinking disk size is not
supported.<BR><BR>-digest string<BR><BR>Prevent changes if current
configuration file has different<BR>SHA1 digest. This can be used to prevent
concurrent<BR>modifications.<BR><BR>-skiplock boolean<BR><BR>Ignore locks -
only root is allowed to use this option.<BR><BR><BR>----- Mail original
-----<BR><BR>De: "Cesar Peschiera" < <A href="mailto:brain@click.com.py"
target=_blank>brain@click.com.py</A> ><BR>À: "Daniel Hunsaker" < <A
href="mailto:danhunsaker@gmail.com" target=_blank>danhunsaker@gmail.com</A>
>, "Alexandre DERUMIER" < <A href="mailto:aderumier@odiso.com"
target=_blank>aderumier@odiso.com</A> ><BR>Cc: <A
href="mailto:pve-devel@pve.proxmox.com"
target=_blank>pve-devel@pve.proxmox.com</A><BR>Envoyé: Jeudi 27 Novembre
2014 21:01:28<BR>Objet: Re: [pve-devel] Error between PVE and
LVM<BR><BR>Thanks Daniel, your words are encouraging for the future of PVE
and for me.<BR><BR>But for this moment, i have two questions:<BR>1) Do I
have any simpler option to grow my LV(that is the HDD of the VM)
by<BR>CLI?<BR>2) If the answer is correct, what exactly should i
execute?<BR><BR>Best regards<BR>Cesar<BR><BR><BR>----- Original Message
-----<BR>From: Daniel Hunsaker<BR>To: Alexandre DERUMIER ; Cesar
Peschiera<BR>Cc: <A href="mailto:pve-devel@pve.proxmox.com"
target=_blank>pve-devel@pve.proxmox.com</A><BR>Sent: Thursday, November 27,
2014 3:37 PM<BR>Subject: Re: [pve-devel] Error between PVE and
LVM<BR><BR><BR>If the GUI is resizing volumes, the API supports it, which
means you should<BR>be able to use `pvesh` to do the operation in one
command, instead of using<BR>the LVM commands and QEMU monitor directly. It
does only support specifying<BR>the new size in bytes (which it seems to
convert to MiB before actually<BR>using), but it's still an
option.<BR><BR>As for the "max available" option, I'd personally find it
more useful to<BR>upgrade the API itself support the full range of `lvresize
-L` values (it<BR>currently uses `lvextend`, which means volumes cannot be
reduced in size - a<BR>fairly safe approach in case the filesystem inside
the VM hasn't been<BR>reduced in advance, but also a bit restrictive), or at
least the largest<BR>subset we could also support for other storage plugins.
I'll see about<BR>implementing that if nobody else gets to it
first.<BR><BR><BR>On Thu, Nov 27, 2014, 09:15 Alexandre DERUMIER < <A
href="mailto:aderumier@odiso.com" target=_blank>aderumier@odiso.com</A> >
wrote:<BR><BR>>>This process is correct when you use the GUI, but when
you have space<BR>>>limited in the hard disk, and you want to change
some partitions by CLI,<BR>>>where finally will be working with the
logical volumes, is when starting<BR>>>the<BR>>>problem due that
the VM not see the change applied.<BR><BR>ah ok.<BR><BR>This is normal, you
need to tell to qemu what is the new size.<BR>(This is what we are doing in
the code : vm_mon_cmd($vmid, "block_resize",<BR>device => $deviceid, size
=> int($size)); )<BR><BR>if you manually upgrade the disk size,<BR>you
need to use the monitor :<BR><BR>#block_resize device
size<BR><BR>ex:<BR><BR>#block_resize drive-virtio0
sizeinbytes<BR><BR><BR><BR><BR><BR><BR><BR>----- Mail original
-----<BR><BR>De: "Cesar Peschiera" < <A href="mailto:brain@click.com.py"
target=_blank>brain@click.com.py</A> ><BR>À: "Alexandre DERUMIER" < <A
href="mailto:aderumier@odiso.com" target=_blank>aderumier@odiso.com</A>
><BR>Cc: <A href="mailto:pve-devel@pve.proxmox.com"
target=_blank>pve-devel@pve.proxmox.com</A><BR>Envoyé: Jeudi 27 Novembre
2014 17:00:37<BR>Objet: Re: [pve-devel] Error between PVE and LVM<BR><BR>Hi
Alexandre<BR><BR>>This value correctly change after resize ?<BR>If,
before change, the logical volume had a smaller size.<BR><BR>>We first
extend the lvm disk, then we tell to qemu the new disk.<BR>This process is
correct when you use the GUI, but when you have space<BR>limited in the hard
disk, and you want to change some partitions by CLI,<BR>where finally will
be working with the logical volumes, is when starting the<BR>problem due
that the VM not see the change applied.<BR><BR>Please let me to do two
suggestions:<BR>- Maybe will be better than PVE GUI have a option that say:
"resize to max<BR>available", or something.<BR>I guess that this first
option would be very good due to that the user will<BR>not need calculate
the space available considering the space used in the<BR>metadata of
LVM.<BR><BR>- Moreover, in previous versions of PVE, while that I could see
the<BR>reflected changes into the VM, in the PVE GUI, when i see the size of
his<BR>hard disk, it shows his old size, then i had that remove the disk for
re add<BR>it, only of this manner i could see his new size.<BR><BR>>What
kind of disk do you use in your guest ? virtio ? scsi ? ide
?<BR>Virtio-block, moreover i have good references about virtio-scsi, do you
know<BR>something about virtio-scsi for use it in windows
systems?<BR><BR>Many thanks again for your attention<BR>Best
regards<BR>Cesar<BR><BR><BR>----- Original Message -----<BR>From: "Alexandre
DERUMIER" < <A href="mailto:aderumier@odiso.com"
target=_blank>aderumier@odiso.com</A> ><BR>To: "Cesar Peschiera" < <A
href="mailto:brain@click.com.py" target=_blank>brain@click.com.py</A>
><BR>Cc: < <A href="mailto:pve-devel@pve.proxmox.com"
target=_blank>pve-devel@pve.proxmox.com</A> ><BR>Sent: Thursday, November
27, 2014 6:35 AM<BR>Subject: Re: [pve-devel] Error between PVE and
LVM<BR><BR><BR>So,<BR><BR>>>shell# lvs<BR>>>LV VG Attr LSize
Pool Origin Data% Move Log Copy% Convert<BR>>>vm-100-disk-1 drbdvg2
-wi------ 30.00g<BR><BR>This value correctly change after resize
?<BR><BR><BR><BR>the resize code is here:<BR><BR>we first extend the lvm
disk, then we tell to qemu the new disk.<BR><BR>(What kind of disk do you
use in your guest ? virtio ? scsi ? ide
?)<BR><BR><BR><BR><BR>/usr/share/perl5/PVE/ QemuServer.pm<BR><BR><BR>sub
qemu_block_resize {<BR>my ($vmid, $deviceid, $storecfg, $volid, $size) =
@_;<BR><BR>my $running = check_running($vmid);<BR><BR>return if
!PVE::Storage::volume_resize($ storecfg, $volid,
$size,<BR>$running);<BR><BR>return if !$running;<BR><BR>vm_mon_cmd($vmid,
"block_resize", device => $deviceid, size
=><BR>int($size));<BR><BR>}<BR><BR><BR>/usr/share/perl5/PVE/Storage/
LVMPlugin.pm<BR><BR>sub volume_resize {<BR>my ($class, $scfg, $storeid,
$volname, $size, $running) = @_;<BR><BR>$size = ($size/1024/1024) .
"M";<BR><BR>my $path = $class->path($scfg, $volname);<BR>my $cmd =
['/sbin/lvextend', '-L', $size, $path];<BR>run_command($cmd, errmsg =>
"error resizing volume '$path'");<BR><BR>return 1;<BR>}<BR><BR>----- Mail
original -----<BR><BR>De: "Cesar Peschiera" < <A
href="mailto:brain@click.com.py" target=_blank>brain@click.com.py</A>
><BR>À: "Alexandre DERUMIER" < <A href="mailto:aderumier@odiso.com"
target=_blank>aderumier@odiso.com</A> ><BR>Cc: <A
href="mailto:pve-devel@pve.proxmox.com"
target=_blank>pve-devel@pve.proxmox.com</A><BR>Envoyé: Jeudi 27 Novembre
2014 09:11:29<BR>Objet: Re: [pve-devel] Error between PVE and LVM<BR><BR>Hi
Alexandre<BR><BR>Thanks for your attention, here my answers and suggestions
about of the<BR>problem of your customer:<BR><BR>>We have made no change
since resize feature has been implemented.<BR>>Can you describe a little
bit more the problem on the guest side ?<BR>>do you see disk size
increase with parted/fdisk ?<BR>I see the new size (vm-100-disk-1) of the
logical volume by CLI, but it<BR>isn't reflected into the VM.<BR>In my case
DRBD is in a upper layer to the LV, but the concept of LVM is<BR>applicable
for any Logical Volume in any kind of block device that Linux
can<BR>recognise.<BR>shell# lvs<BR>LV VG Attr LSize Pool Origin Data% Move
Log Copy% Convert<BR>vm-100-disk-1 drbdvg2 -wi------ 30.00g<BR>data pve
-wi-ao--- 143.50g<BR>root pve -wi-ao--- 20.00g<BR>swap pve -wi-ao---
20.00g<BR><BR>>I have add a customer during a previous training session,
which have<BR>>problem with raw lvm disk in vms,<BR>I don't have problems
with the VMs (LVM or raw image file), only with the<BR>LVM resize by
CLI.<BR><BR>>because of proxmox host scanning all lvm disks on the host
side. (Don't<BR>>remember if it's have impact on resize).<BR>It don't
have impact on resize, and it is necessary for that LVM can manage<BR>the
changes online included (VM and host), that it is my case.<BR>Moreover, for
my DRBD resources, i use this filter on the lvm.conf file for<BR>avoid
scanning all lvm disks:<BR><BR>filter = [ "r|/dev/sdb1|", "r|/dev/sdc1|",
"r|/dev/sdd1|", "r|/dev/sde1|",<BR>"r|/dev/disk/|", "r|/dev/block/|",
"a/.*/" ]<BR>Where:<BR>a=accept (include) , and<BR>r=reject (exclude) the
scans to speed startup.<BR><BR>>We have need to add a filter in lvm.conf
on the host, to exclude scan of<BR>>vms lvm disk.<BR>Sure, i use the
CLI<BR><BR>An additional note of IBM:<BR>In the best practices, LVM as block
device is the mode more fast for get the<BR>better performance in reads and
writes of disks.<BR><BR>Official Web page of IBM in "Best practice: Use
block devices for VM<BR>storage":<BR><A
href="http://www-01.ibm.com/support/"
target=_blank>http://www-01.ibm.com/support/</A> knowledgecenter/linuxonibm/
liaat/liaatbpblock.htm<BR><BR>And finally, my question:<BR>Can be corrected
my problem?<BR><BR>Best regards<BR>Cesar<BR><BR>----- Original Message
-----<BR>From: "Alexandre DERUMIER" < <A
href="mailto:aderumier@odiso.com" target=_blank>aderumier@odiso.com</A>
><BR>To: "Cesar Peschiera" < <A href="mailto:brain@click.com.py"
target=_blank>brain@click.com.py</A> ><BR>Cc: < <A
href="mailto:pve-devel@pve.proxmox.com"
target=_blank>pve-devel@pve.proxmox.com</A> ><BR>Sent: Thursday, November
27, 2014 3:47 AM<BR>Subject: Re: [pve-devel] Error between PVE and
LVM<BR><BR><BR>Hi,<BR><BR>>>In previous versions of PVE, this task was
possible do it with much<BR>>>easily.<BR><BR>We have made no change
since resize feature has been implemented.<BR>Can you describe a little bit
more the problem on the guest side ?<BR>do you see disk size increase with
parted/fdisk ?<BR><BR>Do you use raw lvm disk in your vms ? or partitions on
top of lvm ?<BR>I have the LVM partition, and the image of the virtual disk
isn't on a file<BR>system (as raw, qcow2, or any other kind of file format),
so my image disk<BR>is a LVM as block device.<BR><BR>I have add a customer
during a previous training session, which have problem<BR>with raw lvm disk
in vms,<BR><BR>because of proxmox host scanning all lvm disks on the host
side. (Don't<BR>remember if it's have impact on resize).<BR><BR>We have need
to add a filter in lvm.conf on the host, to exclude scan of vms<BR>lvm
disk.<BR><BR>----- Mail original -----<BR><BR>De: "Cesar Peschiera" < <A
href="mailto:brain@click.com.py" target=_blank>brain@click.com.py</A>
><BR>À: <A href="mailto:pve-devel@pve.proxmox.com"
target=_blank>pve-devel@pve.proxmox.com</A><BR>Envoyé: Jeudi 27 Novembre
2014 07:15:19<BR>Objet: [pve-devel] Error between PVE and LVM<BR><BR>Hi to
the PVE team.<BR><BR>I found a problem between PVE and
LVM.<BR><BR>Considering that if it is used LVM as block device for the
virtual disks of<BR>the VMs, Linux give us a great comfort, but the problem
is that if I in<BR>"online mode" enlarge a Physical Volume and after enlarge
a Logical Volume<BR>by CLI, in PVE, the VM can not see the new free hard
disk space without<BR>partition.<BR><BR>In previous versions of PVE, this
task was possible do it with much easily.<BR><BR>Moreover, i think that this
feature is very util, due to that in the actual<BR>condition, it force me to
power off the VM and start it again, so that being<BR>a server (talking
about of the VM) that is in a production environment, only<BR>can I do it
outside of working hours.<BR><BR>So i would like to ask if the PVE team have
interest in correcting this<BR>problem.<BR><BR>Best
regards<BR>Cesar<BR><BR>______________________________
_________________<BR>pve-devel mailing list<BR><A
href="mailto:pve-devel@pve.proxmox.com"
target=_blank>pve-devel@pve.proxmox.com</A><BR><A
href="http://pve.proxmox.com/cgi-"
target=_blank>http://pve.proxmox.com/cgi-</A>
bin/mailman/listinfo/pve-devel<BR>______________________________
_________________<BR>pve-devel mailing list<BR><A
href="mailto:pve-devel@pve.proxmox.com"
target=_blank>pve-devel@pve.proxmox.com</A><BR><A
href="http://pve.proxmox.com/cgi-"
target=_blank>http://pve.proxmox.com/cgi-</A>
bin/mailman/listinfo/pve-devel<BR></BLOCKQUOTE></DIV></BLOCKQUOTE></BODY></HTML>