on Monday 20 June 2011 Tomas Lestach wrote:

> > ...
> > so I digged a bit and it fails in CobblerVirtualSystemCommand.java
> > 
> > at:
> >             setupVirtAttributes(details.getMemMb().intValue(),
> >             
> >                             details.getDiskGb().intValue(),
> >                             details.getVcpus().intValue(),
> >                             details.getDiskPath());
> > 
> > the details.getDiskPath() returns NULL and that raises an exception.
> 
> Yes, you're right, this is the cause of the problem.

I found some more problems in the code and I have attached a patch.
The default disk size will be set to 2TB instead of 2GB - that's easy to fix 
in the Java Code but there is one more problem in the pythion code in 
kickstart_guest.py
Some values are set to "None" and it's not possible to transfer "None" via 
XMLRPC. You'll get an error like:

Error code: 1While running 'queue.get': caught
<type 'exceptions.TypeError'> : cannot marshal None unless allow_none is
enabled

when you try to call rhn_check to start the installation of the virt-machine.

So I added another patch that will set those Null values to an empty string.
Unfortunately that's not possible with the virt-bridge string. Koan will 
complain when that string is empty, so I had to set that to a static value 
"br0".
That's for sure not the real patch, it just helps you to see where I found the 
problems. I can do installations now but the static "br0" really annoys me.

Do you have an idea how to fix that in a clean way?


-- 
ciao, Uwe Gansert

Uwe Gansert
SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg)
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
Home: http://www.suse.de/~ug - Blog: http://suse.gansert.net
diff --git a/backend/server/action/kickstart_guest.py b/backend/server/action/kickstart_guest.py
index e89f730..daa5ebc 100644
--- a/backend/server/action/kickstart_guest.py
+++ b/backend/server/action/kickstart_guest.py
@@ -99,6 +99,13 @@ def initiate(server_id, action_id, dry_run=0):
     if not boot_image:
         raise InvalidAction("Boot image missing")
 
+    if disk_path == None:
+        disk_path = ""
+    if append_string == None:
+        append_string = ""
+    if virt_bridge == None:
+        virt_bridge = "br0"
+
     return (kickstart_host, cobbler_system_name, virt_type, ks_session_id, name,
                 mem_kb, vcpus, disk_gb, virt_bridge, disk_path, append_string)
 
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index d67598e..7055f3b 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -2078,7 +2078,7 @@ public class SystemHandler extends BaseHandler {
     /**
      *
      * Provision a guest on the server specified.  Defaults to: memory=256MB, vcpu=1,
-     * storage=2048MB.
+     * storage=2GB.
      *
      * @param sessionKey of user making call
      * @param sid of server to provision guest on
@@ -2087,7 +2087,7 @@ public class SystemHandler extends BaseHandler {
      * @return Returns 1 if successful, exception otherwise
      *
      * @xmlrpc.doc Provision a guest on the host specified.  Defaults to:
-     * memory=256MB, vcpu=1, storage=2048MB.
+     * memory=256MB, vcpu=1, storage=2GB.
      * @xmlrpc.param #param("string", "sessionKey")
      * @xmlrpc.param #param("int", "serverId") - ID of host to provision guest on.
      * @xmlrpc.param #param("string", "guestName")
@@ -2097,7 +2097,7 @@ public class SystemHandler extends BaseHandler {
     public int provisionVirtualGuest(String sessionKey, Integer sid, String guestName,
             String profileName) {
         return provisionVirtualGuest(sessionKey, sid, guestName, profileName,
-                new Integer(256), new Integer(1), new Integer(2048));
+                new Integer(256), new Integer(1), new Integer(2));
     }
 
     /**
_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to