Hi,

I use this XML RPC call to create a virtual machine:

res = client.system.provisionVirtualGuest(key, 1000010025, "xml_rpc_vhost", 
"fedora_kickstart_profile" )

that fails with:

Traceback (most recent call last):
  File "./xml.px", line 19, in <module>
    res = client.system.provisionVirtualGuest(key, 1000010025, 
"xml_rpc_vhost", "fedora_kickstart_profile" )
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault -1: 'redstone.xmlrpc.XmlRpcFault: unhandled internal 
exception: XmlRpcException calling cobbler.'>

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.
I don't understand the code perfectly so I'm not sure if that's a bug or a 
problem on my side that  details.getDiskPath() returns nothing.

I added this patch to the code which sets the diskPath in the details object 
and that solves the problem and the job for creating a virtual machine is 
scheduled.
Can someone shed some light into this for me?


--- 
a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java
+++ 
b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java
@@ -17,6 +17,8 @@ package com.redhat.rhn.manager.kickstart.cobbler;
 import com.redhat.rhn.common.conf.ConfigDefaults;
 import com.redhat.rhn.common.validator.ValidatorError;
 import com.redhat.rhn.domain.action.Action;
+import com.redhat.rhn.domain.action.kickstart.KickstartGuestAction;
+import com.redhat.rhn.domain.action.kickstart.KickstartGuestActionDetails;
 import com.redhat.rhn.domain.kickstart.KickstartData;
 import com.redhat.rhn.domain.server.NetworkInterface;
 import com.redhat.rhn.domain.server.Server;
@@ -253,6 +255,11 @@ public class CobblerSystemCreateCommand extends 
CobblerCommand {
         if (!StringUtils.isBlank(mediaPath)) {
             ksmeta.put(KickstartUrlHelper.COBBLER_MEDIA_VARIABLE,
                                                     this.mediaPath);
+            KickstartGuestActionDetails details = 
((KickstartGuestAction)scheduledAction).getKickstartGuestActionDetails();
+            if (details.getDiskPath() == null) {
+               details.setDiskPath(this.mediaPath);
+               
((KickstartGuestAction)scheduledAction).setKickstartGuestActionDetails(details);
+            }
         }
         if (!StringUtils.isBlank(getKickstartHost())) {
             ksmeta.put(SystemRecord.REDHAT_MGMT_SERVER,

-- 
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
listening to: "Run For The Night" by Blind Guardian

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to