[pve-devel] Error between PVE and LVM

Daniel Hunsaker danhunsaker at gmail.com
Thu Nov 27 19:37:11 CET 2014


If the GUI is resizing volumes, the API supports it, which means you should
be able to use `pvesh` to do the operation in one command, instead of using
the LVM commands and QEMU monitor directly. It does only support specifying
the new size in bytes (which it seems to convert to MiB before actually
using), but it's still an option.

As for the "max available" option, I'd personally find it more useful to
upgrade the API itself support the full range of `lvresize -L` values (it
currently uses `lvextend`, which means volumes cannot be reduced in size -
a fairly safe approach in case the filesystem inside the VM hasn't been
reduced in advance, but also a bit restrictive), or at least the largest
subset we could also support for other storage plugins. I'll see about
implementing that if nobody else gets to it first.

On Thu, Nov 27, 2014, 09:15 Alexandre DERUMIER <aderumier at odiso.com> wrote:

> >>This process is correct when you use the GUI, but when you have space
> >>limited in the hard disk, and you want to change some partitions by CLI,
> >>where finally will be working with the logical volumes, is when starting
> the
> >>problem due that the VM not see the change applied.
>
> ah ok.
>
> This is normal, you need to tell to qemu what is the new size.
> (This is what we are doing in the code : vm_mon_cmd($vmid, "block_resize",
> device => $deviceid, size => int($size)); )
>
> if you manually upgrade the disk size,
> you need to use the monitor :
>
> #block_resize device size
>
> ex:
>
> #block_resize drive-virtio0 sizeinbytes
>
>
>
>
>
>
>
> ----- Mail original -----
>
> De: "Cesar Peschiera" <brain at click.com.py>
> À: "Alexandre DERUMIER" <aderumier at odiso.com>
> Cc: pve-devel at pve.proxmox.com
> Envoyé: Jeudi 27 Novembre 2014 17:00:37
> Objet: Re: [pve-devel] Error between PVE and LVM
>
> Hi Alexandre
>
> >This value correctly change after resize ?
> If, before change, the logical volume had a smaller size.
>
> >We first extend the lvm disk, then we tell to qemu the new disk.
> This process is correct when you use the GUI, but when you have space
> limited in the hard disk, and you want to change some partitions by CLI,
> where finally will be working with the logical volumes, is when starting
> the
> problem due that the VM not see the change applied.
>
> Please let me to do two suggestions:
> - Maybe will be better than PVE GUI have a option that say: "resize to max
> available", or something.
> I guess that this first option would be very good due to that the user will
> not need calculate the space available considering the space used in the
> metadata of LVM.
>
> - Moreover, in previous versions of PVE, while that I could see the
> reflected changes into the VM, in the PVE GUI, when i see the size of his
> hard disk, it shows his old size, then i had that remove the disk for re
> add
> it, only of this manner i could see his new size.
>
> >What kind of disk do you use in your guest ? virtio ? scsi ? ide ?
> Virtio-block, moreover i have good references about virtio-scsi, do you
> know
> something about virtio-scsi for use it in windows systems?
>
> Many thanks again for your attention
> Best regards
> Cesar
>
>
> ----- Original Message -----
> From: "Alexandre DERUMIER" <aderumier at odiso.com>
> To: "Cesar Peschiera" <brain at click.com.py>
> Cc: <pve-devel at pve.proxmox.com>
> Sent: Thursday, November 27, 2014 6:35 AM
> Subject: Re: [pve-devel] Error between PVE and LVM
>
>
> So,
>
> >>shell# lvs
> >>LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
> >>vm-100-disk-1 drbdvg2 -wi------ 30.00g
>
> This value correctly change after resize ?
>
>
>
> the resize code is here:
>
> we first extend the lvm disk, then we tell to qemu the new disk.
>
> (What kind of disk do you use in your guest ? virtio ? scsi ? ide ?)
>
>
>
>
> /usr/share/perl5/PVE/QemuServer.pm
>
>
> sub qemu_block_resize {
> my ($vmid, $deviceid, $storecfg, $volid, $size) = @_;
>
> my $running = 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));
>
> }
>
>
> /usr/share/perl5/PVE/Storage/LVMPlugin.pm
>
> sub volume_resize {
> my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
>
> $size = ($size/1024/1024) . "M";
>
> my $path = $class->path($scfg, $volname);
> my $cmd = ['/sbin/lvextend', '-L', $size, $path];
> run_command($cmd, errmsg => "error resizing volume '$path'");
>
> return 1;
> }
>
> ----- Mail original -----
>
> De: "Cesar Peschiera" <brain at click.com.py>
> À: "Alexandre DERUMIER" <aderumier at odiso.com>
> Cc: pve-devel at pve.proxmox.com
> Envoyé: Jeudi 27 Novembre 2014 09:11:29
> Objet: Re: [pve-devel] Error between PVE and LVM
>
> Hi Alexandre
>
> Thanks for your attention, here my answers and suggestions about of the
> problem of your customer:
>
> >We have made no change since resize feature has been implemented.
> >Can you describe a little bit more the problem on the guest side ?
> >do you see disk size increase with parted/fdisk ?
> I see the new size (vm-100-disk-1) of the logical volume by CLI, but it
> isn't reflected into the VM.
> In my case DRBD is in a upper layer to the LV, but the concept of LVM is
> applicable for any Logical Volume in any kind of block device that Linux
> can
> recognise.
> shell# lvs
> LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
> vm-100-disk-1 drbdvg2 -wi------ 30.00g
> data pve -wi-ao--- 143.50g
> root pve -wi-ao--- 20.00g
> swap pve -wi-ao--- 20.00g
>
> >I have add a customer during a previous training session, which have
> >problem with raw lvm disk in vms,
> I don't have problems with the VMs (LVM or raw image file), only with the
> LVM resize by CLI.
>
> >because of proxmox host scanning all lvm disks on the host side. (Don't
> >remember if it's have impact on resize).
> It don't have impact on resize, and it is necessary for that LVM can manage
> the changes online included (VM and host), that it is my case.
> Moreover, for my DRBD resources, i use this filter on the lvm.conf file for
> avoid scanning all lvm disks:
>
> filter = [ "r|/dev/sdb1|", "r|/dev/sdc1|", "r|/dev/sdd1|", "r|/dev/sde1|",
> "r|/dev/disk/|", "r|/dev/block/|", "a/.*/" ]
> Where:
> a=accept (include) , and
> r=reject (exclude) the scans to speed startup.
>
> >We have need to add a filter in lvm.conf on the host, to exclude scan of
> >vms lvm disk.
> Sure, i use the CLI
>
> An additional note of IBM:
> In the best practices, LVM as block device is the mode more fast for get
> the
> better performance in reads and writes of disks.
>
> Official Web page of IBM in "Best practice: Use block devices for VM
> storage":
> http://www-01.ibm.com/support/knowledgecenter/linuxonibm/
> liaat/liaatbpblock.htm
>
> And finally, my question:
> Can be corrected my problem?
>
> Best regards
> Cesar
>
> ----- Original Message -----
> From: "Alexandre DERUMIER" <aderumier at odiso.com>
> To: "Cesar Peschiera" <brain at click.com.py>
> Cc: <pve-devel at pve.proxmox.com>
> Sent: Thursday, November 27, 2014 3:47 AM
> Subject: Re: [pve-devel] Error between PVE and LVM
>
>
> Hi,
>
> >>In previous versions of PVE, this task was possible do it with much
> >>easily.
>
> We have made no change since resize feature has been implemented.
> Can you describe a little bit more the problem on the guest side ?
> do you see disk size increase with parted/fdisk ?
>
> Do you use raw lvm disk in your vms ? or partitions on top of lvm ?
> I have the LVM partition, and the image of the virtual disk isn't on a file
> system (as raw, qcow2, or any other kind of file format), so my image disk
> is a LVM as block device.
>
> I have add a customer during a previous training session, which have
> problem
> with raw lvm disk in vms,
>
> because of proxmox host scanning all lvm disks on the host side. (Don't
> remember if it's have impact on resize).
>
> We have need to add a filter in lvm.conf on the host, to exclude scan of
> vms
> lvm disk.
>
> ----- Mail original -----
>
> De: "Cesar Peschiera" <brain at click.com.py>
> À: pve-devel at pve.proxmox.com
> Envoyé: Jeudi 27 Novembre 2014 07:15:19
> Objet: [pve-devel] Error between PVE and LVM
>
> Hi to the PVE team.
>
> I found a problem between PVE and LVM.
>
> Considering that if it is used LVM as block device for the virtual disks of
> the VMs, Linux give us a great comfort, but the problem is that if I in
> "online mode" enlarge a Physical Volume and after enlarge a Logical Volume
> by CLI, in PVE, the VM can not see the new free hard disk space without
> partition.
>
> In previous versions of PVE, this task was possible do it with much easily.
>
> Moreover, i think that this feature is very util, due to that in the actual
> condition, it force me to power off the VM and start it again, so that
> being
> a server (talking about of the VM) that is in a production environment,
> only
> can I do it outside of working hours.
>
> So i would like to ask if the PVE team have interest in correcting this
> problem.
>
> Best regards
> Cesar
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20141127/9a4b8178/attachment.htm>


More information about the pve-devel mailing list