[opensuse] KVM virual machine directory
Hi, I have a 30 GB dedicated partition currently mounted as /var. The aim was to have the KVM virtual machines on a separate volume so to be able to install a new Leap with formatting the system volumes but to be able to selective NOT format the kvm part. AFAIU, the /var is too large as a choice. How should I mount the volume to allow the new system not to conflict with existing var files and in the main moment to protect the installed VMs having them available after a complete new install of leap. Thank you. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 07/25/2017 02:17 AM, stakanov wrote:
How should I mount the volume to allow the new system not to conflict with existing var files and in the main moment to protect the installed VMs having them available after a complete new install of leap.
Thank you.
stakanov, It just depends on where your extra storage exists now? Do you have say 50G of unpartitioned space on a drive you want to use? Are you trying to just choose another non-root filesyste with spare space to hold the images? Do you have a second spare drive you want to mount in your system to hold nothing but kvm images? If you were looking in /var that tells me you do not have a separate drive your are trying to mount somewhere, so I guess you are asking "where in my current filesystem can I either (1) use space on that partition; or possibly (2) you have unpartitioned space on the drive you can create a filesystem out of and then mount somewhere convenient in your FHS tree. With the normal partitions I've seen lately, if you have partitioned one big partition that holds all the pieces of the filesystem, then you basically need to look where there is sufficient space for the images. All thinks considered, I would probably create a /usr/local/images dir to hold images is the filesystem has sufficient space. If you have a spare drive, load it and partition as much of it you want for storage. Create a filesystem on it (say ext4) and then mount that new storage at /usr/local/images. That should give you several ways to approach it that will hopefully fit your circumstance. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tuesday, 25 July 2017 09:17:55 CEST stakanov wrote:
The aim was to have the KVM virtual machines on a separate volume so to be able to install a new Leap with formatting the system volumes but to be able to selective NOT format the kvm part.
Are you looking for /var/lib/libvirt/images or /var/lib/machines? You can mount partitions on subdirectories if you want. Honestly you could even mount your separate partition on /kvm-machines and tell your KVM program that the images can be found in that directory. Just a matter of taste where you want to mount your partition. Also a word of advice: If you use btrfs for your VM directory, turn off copy- on-write. -- Carmen Bianca Bakker <carmen@carmenbianca.eu> PGP: 2A09 F627 39F6 DEC8 CFFC A216 CD0A 90F1 C5CA 0C92
In data martedì 25 luglio 2017 09:59:49 CEST, Carmen Bianca Bakker ha scritto:
Are you looking for /var/lib/libvirt/images or /var/lib/machines? You can mount partitions on subdirectories if you want.
Honestly you could even mount your separate partition on /kvm-machines and tell your KVM program that the images can be found in that directory. Just a matter of taste where you want to mount your partition.
Well, I would look probably for both (as I wish that after a new install I am able to format the system volumes and thus not to loose the kvm things. I think your /kvm-machines is just nice. And @David: I have only one SSD. It is actually a notebook. So I had it partitioned as follows: Dim. Usati Dispon. Uso% Montato su devtmpfs 3,8G 8,0K 3,8G 1% /dev tmpfs 3,8G 8,0M 3,8G 1% /dev/shm tmpfs 3,8G 2,6M 3,8G 1% /run tmpfs 3,8G 0 3,8G 0% /sys/fs/cgroup /dev/mapper/system-root 30G 8,9G 19G 32% / /dev/sda1 379M 63M 292M 18% /boot /dev/mapper/system-home 403G 280G 107G 73% /home /dev/mapper/system-var 30G 1,8G 28G 7% /var tmpfs 778M 0 778M 0% /run/user/484 tmpfs 778M 8,0K 778M 1% /run/user/1000 tmpfs 778M 12K 778M 1% /run/user/1005 tmpfs 778M 24K 778M 1% /run/user/1002 I do use only and exclusively EXT4 (no btrfs). @Bianca: thank you for the advice however, others will find it useful! So I will probably, when I install 42.3, format all system disks and mount the current /var as KMV-something instead, informing then KVM were to look. As I do not have virtualized anything currently, this should be painless. Last question: in order to migrate a virtual machine (kvm), would it be possible to copy both /var/lib/libvirt/images or /var/lib/machines to the new partition in order to overtake all to the new location? Would a simple cp -ax suffice? Thanks in advance. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tuesday, 25 July 2017 11:42:53 CEST stakanov wrote:
In data martedì 25 luglio 2017 09:59:49 CEST, Carmen Bianca Bakker ha scritto:
Are you looking for /var/lib/libvirt/images or /var/lib/machines? You can mount partitions on subdirectories if you want.
Honestly you could even mount your separate partition on /kvm-machines and tell your KVM program that the images can be found in that directory. Just a matter of taste where you want to mount your partition.
Well, I would look probably for both (as I wish that after a new install I am able to format the system volumes and thus not to loose the kvm things. I think your /kvm-machines is just nice.
Are you actually using both directories? I'm using virt-manager to manage my KVM/QEMU VMs, and it only really uses /var/lib/libvirt/images. If I were you, I would probably just mount this separate partition on /var/ lib/libvirt/images to have the least amount of hassle.
Last question: in order to migrate a virtual machine (kvm), would it be possible to copy both /var/lib/libvirt/images or /var/lib/machines to the new partition in order to overtake all to the new location? Would a simple cp -ax suffice?
`cp -ax` won't work, if I understand `-x` well (which stands for `--one-file- system`). I would personally use `rsync -ar`, but you probably have the right idea anyway. You _might_ need to edit some configuration files to inform KVM that the images have moved, but I do not know your setup. -- Carmen Bianca Bakker <carmen@carmenbianca.eu> PGP: 2A09 F627 39F6 DEC8 CFFC A216 CD0A 90F1 C5CA 0C92
participants (3)
-
Carmen Bianca Bakker
-
David C. Rankin
-
stakanov