summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-10-23 11:22:13 -0400
committerJim Meyering <jim@meyering.net>2006-10-23 11:22:13 -0400
commit552a63db5d4f8fc3552e16ac9838a4918b479c99 (patch)
tree1c0c5774585b4c62b9094672fb8ea4357a6f6626
parent0a3264a25afb0cef266a4c11dc3300eb5487a30f (diff)
downloadcobbler-552a63db5d4f8fc3552e16ac9838a4918b479c99.tar.gz
cobbler-552a63db5d4f8fc3552e16ac9838a4918b479c99.tar.xz
cobbler-552a63db5d4f8fc3552e16ac9838a4918b479c99.zip
Don't spawn xm console by default (needs testing).
-rw-r--r--koan.pod4
-rwxr-xr-xkoan/app.py9
-rwxr-xr-xkoan/xencreate.py11
3 files changed, 16 insertions, 8 deletions
diff --git a/koan.pod b/koan.pod
index 5ca5c89a..4b7951b9 100644
--- a/koan.pod
+++ b/koan.pod
@@ -8,7 +8,7 @@ koan --server=<host> --list-profiles
koan --server=<host> --list-systems
-koan --xen --server=<host> --profile=<name>
+koan --xen --server=<host> --profile=<name> [--interactive]
koan --replace-self --server=<host> --profile=<name>
@@ -18,7 +18,7 @@ koan --replace-self --server=<host> --system=<name>
When invoked, koan requests profile information from a remote boot server that has been configured with cobbler. What koan does with the profile data depends on whether it was invoked with --xen or --replace-self.
-For --xen, cobbler will create new Xen domUs on a xen dom0 in accordance to the orders from cobbler.
+For --xen, cobbler will create new Xen domUs on a xen dom0 in accordance to the orders from cobbler. If you add the --interactive flag, you can watch the kickstart as it happens in an "xm console". This is helpful for debugging and is highly recommended until you're sure your kickstarts are fully automated. To exit, use the usual Ctrl + right bracket you use to exit an xm console.
For re-kickstarting ('--replace-self'), this means reprovisioning the system, blowing away any current data and replacing it with the results of a network install.
diff --git a/koan/app.py b/koan/app.py
index 390f13aa..58d6de4f 100755
--- a/koan/app.py
+++ b/koan/app.py
@@ -67,6 +67,10 @@ def main():
dest="verbose",
action="store_false",
help="run (more) quietly")
+ p.add_option("-i", "--interactive",
+ dest="interactive",
+ action="store_true",
+ help="don't run in batch mode (xen only)")
(options, args) = p.parse_args()
full_access = 1
@@ -88,6 +92,7 @@ def main():
k.profile = options.profile
k.system = options.system
k.verbose = options.verbose
+ k.interactive = options.interactive
k.run()
except InfoException, ie:
print str(ie)
@@ -122,6 +127,7 @@ class Koan:
self.is_xen = None
self.is_auto_kickstart = None
self.dryrun = None
+ self.interactive = False
def run(self):
if self.server is None:
@@ -548,7 +554,8 @@ class Koan:
uuid=xencreate.get_uuid(self.calc_xen_uuid(pd)),
kernel=dd['kernel_local'],
initrd=dd['initrd_local'],
- extra=kextra
+ extra=kextra,
+ interactive=self.interactive
)
print results
diff --git a/koan/xencreate.py b/koan/xencreate.py
index 234ac5ec..e9af5db9 100755
--- a/koan/xencreate.py
+++ b/koan/xencreate.py
@@ -164,7 +164,7 @@ def writeConfigXml(cfgdict):
fd.close()
def start_paravirt_install(name=None, ram=None, disk=None, mac=None,
- uuid=None, kernel=None, initrd=None, extra=None):
+ uuid=None, kernel=None, initrd=None, extra=None, interactive=False):
# this app works without libvirt (for auto-kickstart functionality)
# but using xen functions will require it...
import libvirt
@@ -195,10 +195,11 @@ def start_paravirt_install(name=None, ram=None, disk=None, mac=None,
raise XenCreateException("Unable to create domain for guest")
cmd = ["/usr/sbin/xm", "console", "%s" %(dom.ID(),)]
- child = os.fork()
- if (not child):
- os.execvp(cmd[0], cmd)
- os._exit(1)
+ if interactive:
+ child = os.fork()
+ if (not child):
+ os.execvp(cmd[0], cmd)
+ os._exit(1)
time.sleep(5)
os.unlink(kfn)
os.unlink(ifn)