On 2016-08-19 14:23 -0500, William H. ten Bensel wrote:
  I would like to use the spacewalk api system.provisionVirtualGuest,
  however I need the ability to pass extra args to the virt-install line
  that spacewalk would create.  Is there any way to do this?  Am I
  missing something obvious?
  Reasons:
          Do not use DHCP, PXE, etc.  static IP only.  So need to pass
  the IP, gateway, netmask
          I pass parameters on the line which in turn causes actions to
  be taken in the %post section of the kickstart. (cat /proc/cmdline
  during the building of the server)

  Here is an example of the virt-install command that is ran currently.
  virt-install --name=testing123 --ram=8192 --vcpus=4
  --mac=aa:bb:cc:dd:ee:ff
  --location=http://myspacewalk/ks/dist/org/z/distro --disk
  path=/dev/myvolumegroup/testing123_lv --bridge=bridge##
  --extra-args="ks=http://myspacewalk/ks/cfg/org/z/label/mykickstart
  noipv6 noselinux serial console=tty0 console=ttyS0,115200
  ip=xx.yy.zz.aa gateway=xx.yy.zz.aa netmask=xx.yy.zz.aa dns=dns1
  hostname=testing123 hyper=myhyper flag1=yes flag2=yes   "
  --os-type=linux --os-variant=rhel6 --arch=x86_64 --accelerate
  --noautoconsole --nographics
  - Thanks in advance

Hello,
in theory you can set "network" kickstart advanced param:

 
https://github.com/rhinstaller/pykickstart/blob/master/docs/kickstart-docs.rst#network
 https://<spacewalk>/rhn/apidoc/handlers/ProfileHandler.jsp#setAdvancedOptions

for static configuration, but that would require you to have one KS
profile per VM, which is probably not what you want. Another option
would be to create a %post script which would configure network as per
your installer/Anaconda time network configuration:

 https://<spacewalk>/rhn/apidoc/handlers/ProfileHandler.jsp#addScript

Script ittself would construct file like below:

 
https://docs.fedoraproject.org/en-US/Fedora/13/html/Deployment_Guide/s1-networkscripts-interfaces.html

based on what %post script gets from its environment:

 hostname --ip-address
 route -n
 ...

And also you have to somehow configure network for installer. You can
do it via kernel parameters in webUI Systems -> <system> -> Provisioning
-> Kickstart -> Schedule -> Advanced Kickstart Configuration -> Kernel
Options but I have not found a way how to configure it via API (both for
KS and for provisioning).

 https://rhinstaller.github.io/anaconda/boot-options.html#network-options

I would create a Spacewalk BZ for that:

 https://bugzilla.redhat.com/enter_bug.cgi?product=Spacewalk

Regards,
Jan



--
Jan Hutar     Systems Management QA
[email protected]     Red Hat, Inc.

_______________________________________________
Spacewalk-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-list

Reply via email to