Commit 218d635d authored by Leigh Stoller's avatar Leigh Stoller

More little tweaks for loading custom openvz images.

parent c0fe4980
......@@ -69,6 +69,7 @@ my %OPMODES = ("NORMALv2" => 1,
"NORMALv1" => 0,
"PXEFBSD" => 0,
"RELOAD" => 0,
"RELOAD-PCVM"=> 0,
"OPSNODEBSD" => 0,
"PCVM" => 0,
"MINIMAL" => 1,
......@@ -656,6 +657,31 @@ sub RunsOnParent($$)
return 1;
}
#
# Set an entry in the submap that says it runs on a parent.
#
sub SetRunsOnParent($$)
{
my ($self,$parent) = @_;
my ($osid,$osname) = ($self->osid(),$self->osname());
my $def_parentosid = $self->def_parentosid();
my ($posid,$posname) = ($parent->osid(),$parent->osname());
return 0
if (!$self->IsSubOS());
return 1
if ($posid == $def_parentosid);
DBQueryWarn("replace into os_submap set ".
" osid=$osid and parent_osid=$posid")
or return -1;
return 0;
}
#
# Map an osinfo and node type to the actual image.
#
......
......@@ -34,4 +34,19 @@
<value>Fedora</value>
</attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>Fake MFS for PCVMs.</value></attribute>
<attribute name="features"><value>isup</value></attribute>
<attribute name="magic"><value></value></attribute>
<attribute name="mfs"><value>1</value></attribute>
<attribute name="mustclean"><value>0</value></attribute>
<attribute name="op_mode"><value>RELOAD-PCVM</value></attribute>
<attribute name="osname"><value>FRISBEE-MFS-PCVM</value></attribute>
<attribute name="path"><value>/tftpboot/frisbee-pcvm</value></attribute>
<attribute name="pid"><value>emulab-ops</value></attribute>
<attribute name="reboot_waittime"><value>120</value></attribute>
<attribute name="shared"><value>1</value></attribute>
<attribute name="version"><value>7.2</value></attribute>
</osid>
</descriptors>
......@@ -72,9 +72,16 @@ sub Install($$$)
PhaseFail("Could not look up $OPENVZIMAGE osid")
if (!defined($nextosinfo));
my $diskload_osinfo = OSinfo->LookupByName("FRISBEE-MFS-PCVM");
PhaseFail("Could not look up FRISBEE-MFS-PCVM osid")
if (!defined($diskload_osinfo));
Phase "pcvm", "Updating the PCVM node type", sub {
$pcvm->SetAttribute("default_osid", $osinfo->osid()) == 0
or PhaseFail("Could not update the pcvm node type");
$pcvm->SetAttribute("diskloadmfs_osid",
$diskload_osinfo->osid()) == 0
or PhaseFail("Could not update the pcvm node type");
};
Phase "openvz", "Updating the OPENVZ-STD osid", sub {
$osinfo->SetNextOS($nextosinfo) == 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment