Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 71 lines (62 sloc) 1.59 KB
#!/usr/bin/env perl
# this generates an XML template for libvirt domain specification,
# which is tailored to an instance by the node controller
use diagnostics;
use warnings;
use sigtrap;
use strict;
use English; # for descriptive predefined var names
use Data::Dumper; # for debugging: print Dumper($var)
use Getopt::Long;
use FindBin;
$OUTPUT_AUTOFLUSH = 1; # no output buffering
our $use_ramdisk = 0;
our $use_ephemeral = 0;
# deal with command-line parameters
GetOptions('ramdisk' => sub { $use_ramdisk = 1; },
'ephemeral' => sub { $use_ephemeral = 1; }
) or exit (1);
print <<EOF;
<domain type='xen' id='18'>
if ( $use_ramdisk ) {
print " <initrd>BASEPATH/ramdisk</initrd>\n";
print <<EOF;
<cmdline> ro</cmdline>
<disk type='file'>
<source file='BASEPATH/root'/>
<target dev='sda1'/>
if ( $use_ephemeral ) {
print <<EOF;
<disk type='file'>
<source file='BASEPATH/ephemeral'/>
<target dev='sda2'/>
print <<EOF;
<disk type='file'>
<source file='SWAPPATH/swap'/>
<target dev='sda3'/>
<interface type='bridge'>
<source bridge='BRIDGEDEV'/>
<mac address='PRIVMACADDR'/>
<script path='/etc/xen/scripts/vif-bridge'/>
Jump to Line
Something went wrong with that request. Please try again.