Skip to main content

Script XenServer Backups

After upgrading to Citrix XenServer 6.1 Advanced Edition a while ago, I have been enjoying great features, such as "High-Availability" and "VM Protection Policies". I especially liked VM protection with automated snapshots and exports that took practically no time to set up and worked fairly well for a number of small to midsize environments we have partitioned our virtual infrastructure into. Well, my enjoyment proved to be short-lived, XenServer 6.2 came along delivering scalability improvements and also introducing many changes, click here for more information.

I found many of those changes (like XenServer being fully open source; inclusion of software maintenance; simple, single edition packaging; socket based perpetual and annual licensing; etc.) interesting and welcomed them with open arms. All but one:
This spelled the end of my automated protection days (once again, read more about it here). Luckily, I was still able to draw on my by-now-virtually-nonexistent Linux skills (yes, with a lot of help from plentiful online resources) to replace automation magic with scripting and scheduling.

In case someone else finds this helpful and to give credit where it's due, here's a collection of resources:

  • Great post that provides step-by-step instructions and script samples for pretty much everything you are going to need to get started - http://www.charleslabri.com/back-up-xenserver-6-to-network-share-with-fancy-scripting-and-lots-of-fun-and-no-downtime/
  • Email notifications required a quick modification of the "/etc/ssmtp/revaliases" file (a line similar to root:username@xyz.com:smtp.xyz.com); more details here
  • To get things scheduled right refer to one of many resources that describe cron, for example this one
  • To delete old backup files a quick refresher on the find command might be needed, check out the following reference or this two part article - part 1, part 2
  • Finally, if you run Windows based VMs and want to use VSS (seems to work well under W2K8 not so much under W2012), you may want to look into running "C:\Program Files\Citrix\XenTools\install-XenProvider.cmd" to install VSS provider
That's it. I have used information above to schedule jobs that take VM snapshots, export them to NFS-based shares, and keep a set number of them. So far, everything works pretty well.

Comments

Popular posts from this blog

  Copilot Studio: Capabilities, Strategies, Scenarios 💡 Ready to Supercharge Your Team with AI? 🧠 A critical question for every leader: How do you transform the massive potential of AI into a practical, powerful, and cost-effective tool for your entire organization? 🤔 This guide explores various nuances of the AI adoption: 1️⃣ The Innovation Opportunity: The drive to deploy generative AI is reshaping the modern workplace, offering a monumental leap in productivity and creativity. This is the moment to empower your teams. 🚀 2️⃣ The Strategic Blueprint: Unlocking this potential requires a clear strategy. Navigating the licensing models for powerful tools like Microsoft Copilot Studio is the key to maximizing value and avoiding unexpected costs. 🗺 ️▶️ Our new interactive guide makes it simple. We break down the licensing paths, visualize the costs, and provide a clear, actionable roadmap for implementing a winning hybrid AI strategy. See how you can empower everyone, from citizen...
  AI Agents as Trusted IoT/Software Defined Devices 🤖 Your Newest Endpoint Isn’t a Laptop; It’s an AI Agent. Are You Ready to Secure It? Dive into the next frontier of cybersecurity. Autonomous AI agents are no longer just code; they are powerful actors in our digital ecosystems. Treating them as simple software leaves a massive security gap. Our latest report introduces a new paradigm: The AI Agent as a Software-Defined Device. Discover the essential framework for securing the agentic future: ➡️ The Agent-as-Device Model: Learn why abstracting agents as software-defined devices, similar to IoT endpoints, is the key to managing their complexity and risk. Secure the “hardware” (host), “software” (agent logic), and “network” (communications). ➡️ A Digital Passport for AI: Move beyond static API keys. Explore how Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs) create a cryptographic root of trust, giving every agent a verifiable identity and provable permissions. ➡️...
  AI Trends in DevSecOps 🤖 The AI Co-Developer Is Here: Is Your DevSecOps Ready? Dive into the symbiotic evolution of AI and DevSecOps. While AI coding assistants are accelerating development at an incredible pace, they’re also scaling security risks and introducing a new, complex attack surface. Discover the critical shifts redefining secure software development: ➡️ Secure the Foundation First: Learn why 99% of organizations have sensitive data exposed and how to tame the “blast radius” of GenAI tools before deployment by focusing on data security posture. ➡️ The Intelligent IDE: Move beyond just finding flaws. See how AI-generated fixes are revolutionizing secure coding by slashing remediation times and empowering developers to fix vulnerabilities in seconds. ➡️ The War on Noise: Understand how AI is finally solving the false positive problem in CI/CD pipelines, making fully automated security gates an operational reality. ➡️ Think Like the Adversary: Explore the rise of AI Red ...