Commit 4e2cea70 authored by Ryan Jackson's avatar Ryan Jackson
Browse files

Fix broken state transitions for Xen vnodes

parent 88ed83df
......@@ -407,11 +407,17 @@ sub vnodeCreate($$$)
fatal("xen_vnodeCreate: cannot load image without loadinfo\n");
}
# Tell stated we are getting ready for a reload
libvnode::setState("RELOADSETUP");
$lvname = createImageDisk($imagename, $raref);
if (!$lvname) {
fatal("xen_vnodeCreate: cannot create logical volume for $imagename");
}
# Tell stated via tmcd
libvnode::setState("RELOADING");
#
# Since we may have (re)loaded a new image for this vnode, check
# and make sure the vnode snapshot disk is associated with the
......@@ -777,6 +783,7 @@ sub vnodeBoot($)
die("libvnode_xen: vnodeBoot $vnode_id: could not create bridges");
}
libvnode::setState("BOOTING");
# and finally, create the VM
mysystem("xm create $config");
print "Created virtual machine $vnode_id\n";
......@@ -968,9 +975,6 @@ sub createImageDisk($$)
return $lvname;
}
# Tell stated we are getting ready for a reload
libvnode::setState("RELOADSETUP");
my $size = $XEN_LDSIZE;
if (system("/usr/sbin/lvcreate -n $lvname -L ${size}G $VGNAME")) {
print STDERR "libvnode_xen: could not create disk for $image\n";
......@@ -978,9 +982,6 @@ sub createImageDisk($$)
return 0;
}
# Tell stated via tmcd
libvnode::setState("RELOADING");
# Now we just download the file, then let create do its normal thing
my $imagepath = lvmVolumePath($lvname);
my $dret = libvnode::downloadImage($imagepath, 1, $raref);
......
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