diff options
author | Michael Janczyk | 2010-04-06 20:01:24 +0200 |
---|---|---|
committer | Michael Janczyk | 2010-04-06 20:01:24 +0200 |
commit | e437b8813f2a84ccffa3a75ba1f534b38ce72b9c (patch) | |
tree | fcc8c42ec290da4f343797d4eee4c03087fd01df /os-plugins/plugins/xen/OpenSLX/OSPlugin | |
parent | Adding the runlevel linker again (having the upstart component for newer (diff) | |
download | core-e437b8813f2a84ccffa3a75ba1f534b38ce72b9c.tar.gz core-e437b8813f2a84ccffa3a75ba1f534b38ce72b9c.tar.xz core-e437b8813f2a84ccffa3a75ba1f534b38ce72b9c.zip |
cumulative commit of local branch, many changes regarding virtualization
Diffstat (limited to 'os-plugins/plugins/xen/OpenSLX/OSPlugin')
-rw-r--r-- | os-plugins/plugins/xen/OpenSLX/OSPlugin/xen.pm | 116 |
1 files changed, 109 insertions, 7 deletions
diff --git a/os-plugins/plugins/xen/OpenSLX/OSPlugin/xen.pm b/os-plugins/plugins/xen/OpenSLX/OSPlugin/xen.pm index 5e500b49..8af752b4 100644 --- a/os-plugins/plugins/xen/OpenSLX/OSPlugin/xen.pm +++ b/os-plugins/plugins/xen/OpenSLX/OSPlugin/xen.pm @@ -59,24 +59,126 @@ sub getAttrInfo End-of-Here content_regex => qr{^(0|1)$}, content_descr => '1 means active - 0 means inactive', - default => '1', + # set active to 0, later set specially created Xen system to 1 + default => '0', + }, + # attribute 'imagesrc' defines where we can find xen images + 'xen::imagesrc' => { + applies_to_systems => 1, + applies_to_clients => 1, + description => unshiftHereDoc(<<' End-of-Here'), + Where do we store our xen images? NFS? Filesystem? + End-of-Here + content_regex => qr{^(/|nfs://)}, + content_descr => 'local path or URI or "-" (unset)', + default => undef, + }, + # attribute 'tftpdir' defines TFTP dir for network boots /w NAT + 'xen::tftpdir' => { + applies_to_systems => 1, + applies_to_clients => 1, + description => unshiftHereDoc(<<' End-of-Here'), + Do you want to define a stage 4 TFTP dir for netwoork boots? + Needed to boot Xen via NFS, we only need the initramfs + Hint: Mount your TFTP ro via NFS to a local dir + End-of-Here + content_regex => qr{^(/)}, + content_descr => 'local path or "-" (unset)', + default => undef, }, }; } +sub installationPhase +{ + my $self = shift; + my $info = shift; + + $self->{pluginRepositoryPath} = $info->{'plugin-repo-path'}; + $self->{openslxBasePath} = $info->{'openslx-base-path'}; + + # Copy run-virt.include and template files to the appropriate place for + # inclusion in stage4 + my $pluginName = $self->{'name'}; + my $pluginBasePath = + "$self->{openslxBasePath}/lib/plugins/$pluginName/files"; + + foreach my $file ( qw( run-virt.include machine.include hvm.include ) ) { + copyFile("$pluginBasePath/$file", "$self->{pluginRepositoryPath}/"); + chmod 0644, "$self->{pluginRepositoryPath}/$file"; + } + + return; +} + +sub removalPhase +{ + my $self = shift; + my $info = shift; + + return; +} + sub suggestAdditionalKernelModules { my $self = shift; my $makeInitRamFSEngine = shift; my @suggestedModules; - - # Xen needs bridge module and for SUSE 10.2 netloop other OS: to be checked - if ($makeInitRamFSEngine->{'distro-name'} =~ m{^suse}i) { - push @suggestedModules, qw( bridge netloop ) - } - + + # Xen needs bridge module, for guests xennet and maybe xenblk + # earlier versions needed netloop + push @suggestedModules, qw( bridge xennet xenblk ); + return @suggestedModules; } +#sub _xenLabel +#{ +# # set label for each Xen system +# foreach my $info (@$systemInfos) { +# if ($info->{xen::active} eq 1) { +# my $label = $info->{label} || ''; +# if (!length($label) || $label eq $info->{name}) { +# if ($info->{name} =~ m{^(.+)::(.+)$}) { +# my $system = $1; +# my $exportType = $2; +# $label = $system . "-xen" . ' ' x (36-length($system)) +# . $exportType; +# } else { +# $label = $info->{name}; +# } +# } +# } +# $info->{pxeLabel} = $label; +# } +# return $info; #??? +#} + +#sub _xenBootEntry +#{ +# # Xen entries look different +# # Example: +# # KERNEL mboot.c32 vendor-os/xen.gz dom0_mem=128000 --- +# # vendor-os/vmlinuz-xen debug=3 --- vendor-os/initramfs-1 +# # TODO: versionsort oder per attr? +# if ($info->{xen::active} eq 1) { +# my $xenKernel = slxsystem(ls /boot/xen* | sort | tail -n 1); +# $append .= " file=$bootURI" if length($bootURI); +# $append .= " file=$tftpPrefix" if length($tftpPrefix); +# $append .= " $clientAppend"; +# $append .= " --- $pxePrefix$vendorOSName/$info->{'initramfs-name'}"; +# $slxLabels .= "LABEL openslx-$info->{'external-id'}-xen\n"; +# # $slxLabels .= $pxeDefault; +# $slxLabels .= "\tMENU LABEL ^$info->{pxeLabel}\n"; +# $slxLabels .= "\tKERNEL mboot.c32\n"; +# $slxLabels .= "\tAPPEND $pxePrefix$vendorOSName/$xenKernel"; +# # $slxLabels .= " dom0_mem=128000"; +# $slxLabels .= " --- $pxePrefix$vendorOSName/$kernelName"; +# $slxLabels .= " --- $append\n"; +# $slxLabels .= "\tIPAPPEND 3\n"; +# } +# return $slxLabels; +#} + 1; |