summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-04-20 13:37:28 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-04-20 13:37:28 -0400
commitf00a7e2466789d41733e53318fdd9ed71b4a06f6 (patch)
tree2f1289d09a79db1921ea608892e4339918cda57f
parente4eaff5f72258699608899cea2f7d7607bcb8fa2 (diff)
downloadcobbler-f00a7e2466789d41733e53318fdd9ed71b4a06f6.tar.gz
cobbler-f00a7e2466789d41733e53318fdd9ed71b4a06f6.tar.xz
cobbler-f00a7e2466789d41733e53318fdd9ed71b4a06f6.zip
Add ability to override the name of a virtual domain using the koan command
line, rather than taking the MAC address as the default. Also update manpage.
-rw-r--r--CHANGELOG1
-rw-r--r--koan.pod6
-rwxr-xr-xkoan/app.py15
-rwxr-xr-xkoan/virtcreate.py10
4 files changed, 22 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG
index c1d55695..d98dc50a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,7 @@ Koan CHANGELOG
* Thu Apr 19 2007 Michael DeHaan <mdehaan@redhat.com> - 0.2.9-1
- koan now speaks XMLRPC with cobbler (requires cobbler > 0.4.7-4)
+- allow any RAM size >128MB.
* Fri Mar 23 2007 Michael DeHaan <mdehaan@redhat.com> - 0.2.8-3
- Remove redundant code for --virt-name handling.
diff --git a/koan.pod b/koan.pod
index 1870c573..36c051e9 100644
--- a/koan.pod
+++ b/koan.pod
@@ -8,9 +8,9 @@ koan --server=<host> --list-profiles
koan --server=<host> --list-systems
-koan --virt --server=<host> --profile=<name>
+koan --virt --server=<host> --profile=<name> [--virtname=<name>]
-koan --virt --server=<host> --system=<name>
+koan --virt --server=<host> --system=<name> [--virtname=<name>]
koan --replace-self --server=<host> --profile=<name>
@@ -20,7 +20,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 --virt or --replace-self.
-For --virt, cobbler will create new virtualized guests on a machine in accordance to the orders from cobbler. You can then, once finished, use "virsh" and "xm" commands on the guest. Cobbler automatically names domains based on their mac addresses.
+For --virt, cobbler will create new virtualized guests on a machine in accordance to the orders from cobbler. You can then, once finished, use "virsh" and "xm" commands on the guest. Cobbler automatically names domains based on their mac addresses. To install using a more descriptive name, specify one with --virtname.
For re-kickstarting ('--replace-self'), cobbler will 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 91670dc7..16657eff 100755
--- a/koan/app.py
+++ b/koan/app.py
@@ -56,6 +56,9 @@ def main():
dest="is_virt",
action="store_true",
help="requests new virtualized image installation")
+ p.add_option("-V", "--virtname",
+ dest="virtname",
+ help="force the virtual domain to use this name")
p.add_option("-r", "--replace-self",
dest="is_auto_kickstart",
action="store_true",
@@ -98,9 +101,12 @@ def main():
k.profile = options.profile
k.system = options.system
k.verbose = options.verbose
+ if options.virtname is not None:
+ k.virtname = options.virtname
if options.port is not None:
- k.port = options.port
+ k.port = options.port
k.run()
+
except InfoException, ie:
print str(ie)
return 1
@@ -137,6 +143,7 @@ class Koan:
self.is_auto_kickstart = None
self.dryrun = None
self.port = 25151
+ self.virtname = None
def run(self):
if self.server is None:
@@ -611,8 +618,8 @@ class Koan:
uuid=virtcreate.get_uuid(self.calc_virt_uuid(pd)),
kernel=self.safe_load(dd,'kernel_local'),
initrd=self.safe_load(dd,'initrd_local'),
- extra=kextra
- # interactive=self.interactive
+ extra=kextra,
+ nameoverride=self.virtname
)
print results
@@ -648,7 +655,7 @@ class Koan:
int(size)
except:
err = True
- if size is None or size == '' or int(size) < 256:
+ if size is None or size == '' or int(size) < 128:
err = True
if err:
self.debug("invalid RAM size specified, defaulting to 256 MB")
diff --git a/koan/virtcreate.py b/koan/virtcreate.py
index e028721f..f5731733 100755
--- a/koan/virtcreate.py
+++ b/koan/virtcreate.py
@@ -74,7 +74,7 @@ def get_mac(mac):
def start_paravirt_install(ram=None, disk=None, mac=None,
- uuid=None, kernel=None, initrd=None, extra=None):
+ uuid=None, kernel=None, initrd=None, extra=None, nameoverride=None):
if mac == None:
@@ -84,7 +84,11 @@ def start_paravirt_install(ram=None, disk=None, mac=None,
guest = virtinst.ParaVirtGuest()
guest.set_boot((kernel,initrd))
guest.set_extra_args(extra)
- guest.set_name(macname)
+ if nameoverride is None:
+ usename = macname
+ else:
+ usename = nameoverride
+ guest.set_name(usename)
guest.set_memory(ram)
guest.set_vcpus(1) # FIXME!
guest.set_graphics(False)
@@ -101,5 +105,5 @@ def start_paravirt_install(ram=None, disk=None, mac=None,
guest.start_install()
- return "reconnect with xm console %s" % macname
+ return "reconnect with xm console %s" % usename