Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Is KVM the best for this setup?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Is KVM the best for this setup?

elwebmasterelwebmaster Member
edited October 2016 in Help

I want to be able to quickly create, start and stop VMs with the following setup:

1) Pre-made image with Docker (all VMs must use the same image/template, installing OS is not acceptable)
2) 4-8GB memory per VM
3) Ideally, I want to be able to configure the same IP to multiple VMs (with only one running at a time, the rest "powered off"). I can probably work something out with NAT if that's not possible.

This is how I am planning to set it up:

1) Create a KVM VM with an empty disk image and boot2docker .iso .
2) Make all configurations on the disk image (boot2docker mounts it automatically on boot).
3) Copy the disk image many times (say 50 times) and assign each to a KVM VM together with the boot2docker .iso (powered off).
4) Assign 5 IPs to 1 VM each and power them on.
5) At any given time I want to be able to switch on and off VMs and recycle these same 5 IPs.

I don't have much experience with KVM so I don't know if it's the right choice for this kind of setup or if OpenVZ with a template would be better (I know it has some issues with Docker, but can be made to work). I can also use VirtualBox if it's better.

This will not be for production use, but I still want to squeeze as much as possible out of the available hardware (hardware is still TBD). I am particularly worried about disk I/O and I don't want to waste memory (i.e. the VMs may not need all assigned memory, it should be made available to other VMs then).

Comments

  • WilliamWilliam Member
    edited October 2016

    Too complicated - set up DHCP and give each VM IPs based on MAC (can just count the MAC up and assign IPs from a NAT pool or 1:1 DNAT with all ports), bam - unique IPs and you know which VM is which. Else if you have background tasks/no access needed just give them DHCP IPs at random with normal lease times.

    Forget Docker inside OVZ, forget Virtualbox, forget LXC - Just use KVM, i'd use Proxmox and just script around the CLI.

    As for IO - VirtIO is very performant (few % overhead) but still not as near native as simfs (OVZ old) or ploop (OVZ new, slower as it is a file in a way).

  • @William said:
    Too complicated - set up DHCP and give each VM IPs based on MAC (can just count the MAC up and assign IPs from a NAT pool or 1:1 DNAT with all ports), bam - unique IPs and you know which VM is which. Else if you have background tasks/no access needed just give them DHCP IPs at random with normal lease times.

    Forget Docker inside OVZ, forget Virtualbox, forget LXC - Just use KVM, i'd use Proxmox and just script around the CLI.

    As for IO - VirtIO is very performant (few % overhead) but still not as near native as simfs (OVZ old) or ploop (OVZ new, slower as it is a file in a way).

    Thanks. Have you tried Docker inside OVZ and know that it does not perform well? I haven't been able to find any performance comparisons between Docker in OVZ and Docker in KVM. I know that the vfs driver is slow to create containers, but I won't be creating any containers inside the VM, all VMs will have their containers pre-configured.

    I think VirtIO won't work our of the box with the boot2docker.iso :(

  • DETioDETio Member
    edited October 2016

    @elwebmaster said:
    I want to be able to quickly create, start and stop VMs with the following setup:

    1) Pre-made image with Docker (all VMs must use the same image/template, installing OS is not acceptable)
    2) 4-8GB memory per VM
    3) Ideally, I want to be able to configure the same IP to multiple VMs (with only one running at a time, the rest "powered off"). I can probably work something out with NAT if that's not possible.

    This is how I am planning to set it up:

    1) Create a KVM VM with an empty disk image and boot2docker .iso .
    2) Make all configurations on the disk image (boot2docker mounts it automatically on boot).
    3) Copy the disk image many times (say 50 times) and assign each to a KVM VM together with the boot2docker .iso (powered off).
    4) Assign 5 IPs to 1 VM each and power them on.
    5) At any given time I want to be able to switch on and off VMs and recycle these same 5 IPs.

    I don't have much experience with KVM so I don't know if it's the right choice for this kind of setup or if OpenVZ with a template would be better (I know it has some issues with Docker, but can be made to work). I can also use VirtualBox if it's better.

    This will not be for production use, but I still want to squeeze as much as possible out of the available hardware (hardware is still TBD). I am particularly worried about disk I/O and I don't want to waste memory (i.e. the VMs may not need all assigned memory, it should be made available to other VMs then).

    KVM & Docker are your choices, Docker is more efficient however KVM is more robust.

    Actually, we are OpenSource and I'd recommend you to check VirtEngine out, https://github.com/VirtEngine/Dash

    Our documentation has more Info: https://docs.virtengine.com/ (Pricing is for the Minified/Complete Edition which are for hosting providers.) OpenSource is free for private clouds..

    We support KVM, Docker. Our software allows you to launch one VM, do whatever you'd like - snapshot the machine and launch 50 more copies in minutes.

    Or you can create an Image in Docker Hub launch as many copies as you want.

    You can then manage all the above VM's/Containers with one Security Key - Nifty.

  • Why have multiple KVM vms over one larger Docker host?
    You could then script your infrastructure with something like Terraform to strip down parts of the environment and rebuild it at will.

  • @vexilla said:
    Why have multiple KVM vms over one larger Docker host?
    You could then script your infrastructure with something like Terraform to strip down parts of the environment and rebuild it at will.

    Yes, that's what I am considering. There are security issues that I need to look more into, before I decide to go this way. It is essential that docker containers cannot "break out" and access any other docker containers, including network & filesystem access. But I think with vlans this should be possible. I gave up on the idea of having one IP per VM, I will be doing NAT there.

Sign In or Register to comment.