KVM and XenServer Best Practices



  • Curious to know if anyone has any documentation or resources in regards to managing XenServer and KVM hypervisors and VMs. Specifically in regards to Backups and system resource allocation.

    I've seen LVM snapshots being recommended for VM backups, and I've recently seen responses saying that is not the appropriate way to manage VM backups with XenServer.

    I'm mostly looking for clarity and a solid source to reference for an upcoming Hypervisor upgrade and possible overhaul... I'm currently using KVM at the office, and looking to implement XenServer at home in my test lab.



  • @RamblingBiped said:

    I've seen LVM snapshots being recommended for VM backups, and I've recently seen responses saying that is not the appropriate way to manage VM backups with XenServer.

    LVM is recommended by people, almost universally, that read the actual recommendations and did not understand them and interpreted them in some weird way. LVM hasn't been recommended and that LVM-like process has not been recommended on any platform for a decade. Every time I talk to someone who repeats the LVM as the recommended way it always turns out that their source for that told them to take snapshots and they didn't realize where snapshots came from and just assumed LVM because they were thinking in terms of Linux and not virtualization.



  • Not that you can't use LVM, but it is not a best practice or recommended and is a bit more limited than using files. When you go LVM, the assumptions around the benefits of virtualization start to fade and things that you just assume will work, don't necessarily.



  • @RamblingBiped XenServer is quite a good platform. With that said there are some gotcha's to watch out for. Like Dom0 becoming full because of a misconfigured backup script (NAUBackup - Free Backup Tool for backing up your VM's).

    Dom0 Hard drive space maintenance is Critical!!
    The below command will list the free space in a readable format on the primary partion (dom0)

    1. df –h | grep “/$” | head –n 1
      The below commands will list all directories 1 folder deep, and how much file space each directory is using.
    2. cd /
    3. du –hc –max-depth=1

    The below commands will remove log files (.log) and backup log files (.gz) from the server in the respective file paths.
    • rm -rf /var/log/installer/.log
    • rm -rf /var/log/pm/
    .log
    • rm -rf /var/log/xen/.log
    • rm -rf /var/log/
    .gz

    What else are you looking for?



  • @DustinB3403 Ideally I'd like to find a good defacto go-to resource as a reference for this stuff. Best practices for implemening XenServer. Resource allocation, VM backups, etc...

    For my home lab I'm planning on trying to run XenServer from an SD card off of the internal SD card module included specifically for this purpose. From your dom0 space warning I'm guessing I should probably opt for 32GB+ size for this?



  • You can increase the size of the Dom0 partition of your SD card, but have to customize your solution as you're installing the software. Which isn't recommended. It's literally going outside of the recommendation.

    In production we left it at 4GB and we have enough space.

    It's when to get into getting other items configured that you have to be concerned about Dom0 space, but it's still critical.

    All of my documentation is sourced from citrix them selves (just without all of the bloated text)



  • Crontab jobs might make a backup copy as you're scheduling cron jobs or making adjustments. IE: crontab.XXXXGvrDIU

    Which for some reason take a ton of space...

    Making certain you clean up any manually downloaded patches (if the built in patcher fails for some reason) and removing log files if they become unwieldy.


Log in to reply