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.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Question about Xen
Hey guys (...and girls),
I want to create many many small VMs (say 128MB, 1 core). I'm thinking of grabbing a Hetzner E3 and installing XenServer. I did some research but I thought I'd ask before pressing the button.
- Will I be able to create many small VMs with Xen that they will all share the CPU? I mean, I won't have to specify a % of cpu per VM, but it will allow me to just launch a ton of VMs and it will figure the CPU usage on its own, right?
- Will I be able to set the VMs to use the host's IP without any hair-pulling?
- Will I be able to do all that via the command-line remotely (i.e. Xen has a cli tool that I will install locally and will execute commands on the server)
- (optional) Is it possible to let the VMs use as much RAM as they want without a hard limit?
Thank you!
Comments
If the VMs are that small, have you considered just using OpenVZ (assuming each having their own kernel is not a requirement).
It would be a good bit more efficient.
@Awmusic12635 said:
It is indeed
Yes to all except the ram. You have to set the ram I believe.
As for using the hosts IP, do you mean using the same public IP? Like bridged?
As for the CLI, you can set up ssh or view console using xencenter.
I can live with that, good to know beforehand though!
Yes, same public IP - bad wording from me, sorry. I just need the VMs to have Internet access in the simplest way.
Thanks @Jonchun !
IIRC Xenserver does not come with automatic NAT, so you need one instance with pfsense/vyatta/ddwrt/openwrt/linux/whatever to do the routing. Might be able to use iptables if you don#t use bridged networking, but not sure if they removed this for HVM (likely).
Looks like I have a considerable learning curve on my journey. Thanks @William !
Never liked Xen much (rather use Proxmox due to Debian base) but if it works like KVM you need:
2 IPs
1 for host
1 for KVM as router
Configure bridge0 for external eth0 and the router KVM
Configure bridge1 on the router KVM and on each other KVM
Configure NAT with the IP on eth0 of the router KVM (bridge0) towards a /24 (or whatever you need) RFC1918 space on eth1 (bridge1)
Assign each other KVMs eth0 (bridge1) an IP from this RFC1918 network and use the router KVMs int IP as gateway
Software wise you can use anything, DDWRT and OpenWRT are simple, pfsense is higher level but this is still a very basic config, Vyatta/VyOS and alike are overkill (BGP etc.). Linux with iptables works nicely as well, you can adapt most rules from one of the OpenVPN install scripts by just changing tap{?} to the physical interface names.
For install of the router you likely need VNC so not sure about "remotely" which you seem to imply CLI with, you can run CLI install of Linux (basically telnet or SSH to a text install) with some hacks on KVM (boot/kernel args) which likely also works somehow on Xen or you can modify an ISO to include DHCP (could probably google one also fine) or a pre-defined static IP inside your int space.
I found this interesting: http://www.slideshare.net/xen_com_mgr/xpus13-pavlicek
If I understand right, Xen is the hypervisor and you install Linux a distro on dom0 that talks to Xen via command-line tools like
xl
to configure/launch VMs.Instead, XenServer is a specialized distro for dom0 that takes care of networking and other management things (and talks to the Xen hypervisor). It also exposes a remote API.
I need to dig more into it, but that's how I understand it so far.
@deadbeef
http://discussions.citrix.com/topic/328842-vm-with-internet-access-using-nat-via-the-eth0-xenbr0/
Fantastic, thank you!
Np! If you need a server to test the xenserver setup for a couple days and all that before ordering your main server, just let me know and I should be able to help out there as well.
short answer yes.
Long answer : you need to pin the cpus for dom0 or it will be starved by the usage of those small vms.
Also if the number is huge you will be hit hard on context switching overhead so in this case you may need to do a bit of fine tuning to the scheduler so that you decrease the switching and give each vm more time to do anything useful (if the vms do alot of network work it will be very hard)
As other suggested it is doable by either the hacky way as @Jonchun explained or thoughthe other way as @William explained by having 1 vm on the server and run router software on it and use it as gateway for other vms ( i would go with router vm as the other way is hackey and all you have done could be overwritten when you install any xenserver update as they assume no one change the default behavior of the hypervisor)
Note: if you go by router VM make sure you will need also to pin its cpus or you will face issues
Even better , if you go by xenserver (not just xen ) you can use xencenter to manage the server which is a standalone application that let you many stuff without the need of writing any command
and for the command line xenserver use xe toolstack which ispowerfull when you get used to it
you can set the vm to use soft limits for rm and give each high soft max limit. in this case all vms will expand freely as long as there is free ram in the system.
The real issue will start once the ram is fully used as in this case xenserver will start decrease the ram assigned for some vms to server other vms and while it do that the performance will be severly affected.
So in other words dont do it as it will give you almost unusable server when ram is fully used
I recommend using Xen directly, instead of using XenServer.
Any particular reasons?
You can use any Linux distribution as Dom0
Less overhead
You know how things work
More flexible
Ah, I understand now. Thanks for taking the time to type all this, much appreciated!
use KVM, ksm will save you a lot of overhead.
It has to be Xen for compat reasons
I really don't understand, what possible reasons?
I am going to be testing various Unikernels and they mostly work with Xen. Maybe they work with KVM as well, but being bleeding-edge (read: incomplete, full of bugs software) I wouldn't like to diverge from whatever documentation there exists for them.
I understand, just give them all the domU's the same CPU weight and reserve and pin 1 core to the dom0, it will be fine.