Hi ! I'm about to deploy a new server that will host several virtual host for mainly website hosting purposes. My server will be a Xeon 3440 or 3450 with 32 gigs of ram (the max of that board). So I will have 8 logical cores. At the moment, I don't know how many vms I will have, in the order of 5 or 6. I am quite new to managing VMs, I did play alot with them over the course of the last couple of weeks. I used kvm to startup and manage my vms and my main source of info was this blog entry : http://blog.mattbrock.co.uk/2012/02/12/virtualisation-with-kvm-and-lvm-on-centos-6-via-the-command-line/ I have some general questions about VM. If I set vcpu let's say to 2-3 for a single vm, does this mean that those CPU are dedicated to that vm or many vm can share the same physicial cpus ? So, I was wondering what's the best for managing storage for VMs ? I see mostly recomandations for LV for storing VM's disks. It seem to helps to create snapshots for backup purposes. Is this the fastest way of creating backups ? And will data access be faster that if I use regular files ? In my case, the "main" setup of each vm is rather simple. The minimal OS, updates, my own httpd, my own php a couple of other packages. So restoring a VM from scratch can take less than an hour. So I was thinking of not taking snapshot of the whole VM and only sync the data partition. As for the guest paritions, I am accustomed of separating my servers disks with separate /, /usr, /var, /home and /data partitions. I can't recall today why I started doing this, 15 years ago, but I still like it that way and continue to do so. Do I still "need" to do this with VMs ? Thanks for the help !
On Tue, Jun 26, 2012 at 9:05 AM, Nicolas Ross <rossnick-lists at cybercat.ca> wrote:> I have some general questions about VM. > > If I set vcpu let's say to 2-3 for a single vm, does this mean that > those CPU are dedicated to that vm or many vm can share the same > physicial cpus ?No, all the CPU will be virtualized and shared. Although there is "affinity" option where physical CPU is locked to a certain VM. But in general this option gives more bad effect than good.> So, I was wondering what's the best for managing storage for VMs ? I see > mostly recomandations for LV for storing VM's disks. It seem to helps to > create snapshots for backup purposes. Is this the fastest way of > creating backups ? And will data access be faster that if I use regular > files ?Using LV will give you flexibility among other things. Better have it in the beginning rather than sorry later (e.g. running out of space, etc). The performance difference is insignificant.> In my case, the "main" setup of each vm is rather simple. The minimal > OS, updates, my own httpd, my own php a couple of other packages. So > restoring a VM from scratch can take less than an hour. So I was > thinking of not taking snapshot of the whole VM and only sync the data > partition.That's ok.> As for the guest paritions, I am accustomed of separating my servers > disks with separate /, /usr, /var, /home and /data partitions. I can't > recall today why I started doing this, 15 years ago, but I still like it > that way and continue to do so. Do I still "need" to do this with VMs ?The reason of creating separate partitions is mainly for security and preserve data during reinstallation. I believe it's still good to do your way. -- http://linux3.arinet.org
On 06/25/2012 06:05 PM, Nicolas Ross wrote:> > If I set vcpu let's say to 2-3 for a single vm, does this mean that > those CPU are dedicated to that vm or many vm can share the same > physicial cpus ?Normally, they won't be dedicated. You cannot assign more CPUs to a guest than there are in the host system, but you can overcommit CPUs in general. That is, if you have 8 cores, you can create two guests with 6 virtual CPUs each. If the guests both become busy enough to fully utilize 6 CPUs, the performance of each will naturally be degraded relative to only one guest being busy enough to fully utilize 6 CPUs. While CPUs cannot be overcommitted, memory can. Again, if you overcommit memory, the host will swap excess utilization and severely degrade guest performance. Take care to avoid doing this.> So, I was wondering what's the best for managing storage for VMs ? I see > mostly recomandations for LV for storing VM's disks. It seem to helps to > create snapshots for backup purposes. Is this the fastest way of > creating backups ? And will data access be faster that if I use regular > files ?Yes, performance of guests backed by LVs will be significantly better than the performance of guests backed by regular files. No, you cannot make reliable backups of guests using snapshots of the LV. A snapshot taken at any given time may have inconsistent data. Run your backup software in the guest rather than in the host. Under a Linux guest, you're able to snapshot filesystems and make backups. When you make a snapshot under LVM, the file system contained therein is made consistent (though I'm having trouble finding actual documentation to that effect) before the snapshot is taken. If you have open files, you may need to take additional steps to make that data consistent (as you would if you were backing up a MySQL database). Taking a snapshot of a running KVM guest will not make data consistent, so you won't be able to reliably make a backup that way. Finally, do not use snapshots as your primary means of backup. If your media fails, you will lose your data.> As for the guest paritions, I am accustomed of separating my servers > disks with separate /, /usr, /var, /home and /data partitions. I can't > recall today why I started doing this, 15 years ago, but I still like it > that way and continue to do so. Do I still "need" to do this with VMs ?I don't believe there's any more or less need to do so. I would strongly recommend that you not segregate / and /usr. Fedora and future versions of RHEL/CentOS will expect a unified / and /usr.