pxelocal.template and $pxe_menu_items
by Pablo Iranzo Gómez
Hi
I would like to achieve something similar to pxedefault.template but with the custom options of pxelocal.template after a system has been provisoned.
The idea is to offer the full range of profiles to each system as an aditional option.
What I did was to put $pxe_menu_items stanza on the pxelocal.template as I did with pxedefault.template, but no matter what I do, it doesn't get rendered.
After looking at the code at pxegen.py, I can see the metadata["pxe_menu_items"] in "make_actual_pxe_menu" (which outputs pxelinux.cfg/default) but not on the function referencing pxelocal.template ("write_pxe_file"), so my guess is that this is not implemented.
¿any hint?
Thanks in advance
Pablo
--
Pablo Iranzo Gómez (Pablo.Iranzo(a)redhat.com)
Senior Global Profesional Services Consultant (RHCA, RHCSS, RHCDS, RHCVA, RHCE, RHCSP) #804006196923216
Phone: +34 645 01 01 49 (CET/CEST)
GnuPG KeyID: 0xFAD3CF0D
13 years
Re: What does the default_password_crypted field do?
by Robert Cross
Joe Linoff wrote:
> So I ran:
>
> % openssl passwd -1 'testit'
> <value>
>
> and cut-n-pasted the<value> to the "default_password_crypted:" field in
> /etc/cobbler/settings and updated everything:
Doing better than I did then - I could never get this to work with my
CentOS 5.5 cobbler server - anytime I tried it cobbler came back
complaining that the resulting kickstart was corrupt/invalid. In the end
I generate the password with grub-md5-crypt and that seemed to work fine
(well, I've done about a dozen test installs since with no problems. :D
> What does the default_password_crypted field do?
As the comments in the settings file says, this field contains the
encrypted password that'll be assigned to root for your newly
provisioned systems. And the comments also warn you that if don't change
this then you'll get a warning from the 'check' command - which I
thought was a nice touch.
HTH, Bob Cross.
13 years, 2 months
what happens if a snippet doesn't exist?
by Joe Linoff
Hi Folks:
I have a kickstart template step where I customize the users on each
system like this:
# default users for all systems
groupadd -g 2001 admin
useradd --gid 2001 --uid 2001 --create-dir --shell /bin/bash
--password 'sxdSJWdd/lka' admin
## Setup the individual users for this specific machine.
#set local_user_setup = 'users/' + $getVar($name)
$SNIPPET(local_user_setup)
What happens if the users/$name snippet doesn't exist?
Will the kickstart abort?
Can I do a file check to test for existence in the template?
Best regards,
Joe
13 years, 2 months
koan hvm install: TypeError: coercing to Unicode: need string or buffer, NoneType found
by Gilles GAUDIN
Hi,
need help with koan when I use hvm virt type.
On cobbler server I launch following commands:
cobbler system add --name=virttest --mac=[mac address of eth0 on cobbler
server] --profile=Centos5-x86_64 --virt-type=xenfv
cobbler sync
Then on client I launch this command:
koan --server=[IP address of eth0 on cobbler server] --virt --nogfx
--system=virttest --virt-name=vm02
I can see this:
- looking for Cobbler at http://192.168.0.52/cobbler_api
- reading URL: http://192.168.0.52/cblr/svc/op/ks/system/virttest
install_tree: http://192.168.0.52/cblr/links/Centos5-x86_64
libvirtd (pid 2531) en cours d'exécution...
Fri, 28 Jan 2011 18:36:43 DEBUG No conn passed to Guest, opening URI
'None'
- fullvirt mode
libvir: Xen error : Domain not found: xenUnifiedDomainLookupByName
libvir: Xen error : Domain not found: xenUnifiedDomainLookupByUUID
Fri, 28 Jan 2011 18:36:43 DEBUG Generated install XML:
<domain type='xen'>
<name>vm02</name>
<currentMemory>524288</currentMemory>
<memory>524288</memory>
<uuid>dd4fa136-5f95-0872-a4d6-e6c7f3c82243</uuid>
<os>
<type>linux</type>
<boot dev='network'/>
<boot dev='hd'/>
</os>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<vcpu>1</vcpu>
<devices>
<disk type='file' device='disk'>
<driver name='tap'/>
<source file='/var/lib/xen/images/vm02-disk0'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
<mac address='00:13:72:52:D6:DC'/>
</interface>
<input type='mouse' bus='xen'/>
</devices>
</domain>
Fri, 28 Jan 2011 18:36:43 DEBUG Generated boot XML:
<domain type='xen'>
<name>vm02</name>
<currentMemory>524288</currentMemory>
<memory>524288</memory>
<uuid>dd4fa136-5f95-0872-a4d6-e6c7f3c82243</uuid>
<bootloader>/usr/bin/pygrub</bootloader>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<vcpu>1</vcpu>
<devices>
<disk type='file' device='disk'>
<driver name='tap'/>
<source file='/var/lib/xen/images/vm02-disk0'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
<mac address='00:13:72:52:D6:DC'/>
</interface>
<input type='mouse' bus='xen'/>
</devices>
</domain>
libvir: Xen error : Domain not found: xenUnifiedDomainLookupByName
libvir: Xen Daemon error : POST operation failed: xend_post: error from
xen daemon: (xend.err 'Error creating domain: coercing to Unicode: need
string or buffer, NoneType found')
libvirt.libvirtError
POST operation failed: xend_post: error from xen daemon: (xend.err
'Error creating domain: coercing to Unicode: need string or buffer,
NoneType found')
File "/usr/lib/python2.4/site-packages/koan/app.py", line 225, in main
k.run()
File "/usr/lib/python2.4/site-packages/koan/app.py", line 356, in run
self.virt()
File "/usr/lib/python2.4/site-packages/koan/app.py", line 675, in virt
return self.net_install(after_download)
File "/usr/lib/python2.4/site-packages/koan/app.py", line 594, in
net_install
after_download(self, profile_data)
File "/usr/lib/python2.4/site-packages/koan/app.py", line 673, in
after_download
self.virt_net_install(profile_data)
File "/usr/lib/python2.4/site-packages/koan/app.py", line 1157, in
virt_net_install
qemu_driver_type = self.qemu_disk_type
File "/usr/lib/python2.4/site-packages/koan/xencreate.py", line 190,
in start_install
guest.start_install()
File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line
1193, in start_install
start_xml, final_xml, is_initial)
File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line
1252, in _create_guest
dom = self.conn.createLinux(start_xml or final_xml, 0)
File "/usr/lib64/python2.4/site-packages/libvirt.py", line 974, in
createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed',
conn=self)
/var/log/xend.log shows:
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:207) XendDomainInfo.create(['vm', ['name', 'vm02'],
['memory', '512'], ['maxmem', '512'], ['vcpus', '1'], ['uuid',
'dd4fa136-5f95-0872-a4d6-e6c7f3c82243'], ['on_poweroff', 'destroy'],
['on_reboot', 'destroy'], ['on_crash', 'destroy'], ['image', ['linux']],
['device', ['tap', ['dev', 'xvda'], ['uname',
'tap:aio:/var/lib/xen/images/vm02-disk0'], ['mode', 'w']]], ['device',
['vif', ['mac', '00:13:72:52:d6:dc'], ['bridge', 'xenbr0'], ['script',
'vif-bridge']]]])
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:329) parseConfig: config is ['vm', ['name', 'vm02'],
['memory', '512'], ['maxmem', '512'], ['vcpus', '1'], ['uuid',
'dd4fa136-5f95-0872-a4d6-e6c7f3c82243'], ['on_poweroff', 'destroy'],
['on_reboot', 'destroy'], ['on_crash', 'destroy'], ['image', ['linux']],
['device', ['tap', ['dev', 'xvda'], ['uname',
'tap:aio:/var/lib/xen/images/vm02-disk0'], ['mode', 'w']]], ['device',
['vif', ['mac', '00:13:72:52:d6:dc'], ['bridge', 'xenbr0'], ['script',
'vif-bridge']]]]
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:446) parseConfig: result is {'features': None, 'image':
['linux'], 'cpus': None, 'vcpu_avail': None, 'backend': [], 'uuid':
'dd4fa136-5f95-0872-a4d6-e6c7f3c82243', 'on_reboot': 'destroy',
'cpu_weight': None, 'memory': 512, 'cpu_cap': None, 'localtime': None,
'timer_mode': None, 'start_time': None, 'on_poweroff': 'destroy',
'on_crash': 'destroy', 'device': [('tap', ['tap', ['dev', 'xvda'],
['uname', 'tap:aio:/var/lib/xen/images/vm02-disk0'], ['mode', 'w']]),
('vif', ['vif', ['mac', '00:13:72:52:d6:dc'], ['bridge', 'xenbr0'],
['script', 'vif-bridge']])], 'bootloader': None, 'maxmem': 512,
'shadow_memory': None, 'name': 'vm02', 'bootloader_args': None, 'vcpus':
1, 'cpu': None}
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:1784) XendDomainInfo.construct: None
[2011-01-28 18:36:43 xend 2866] DEBUG (balloon:145) Balloon: 524404 KiB
free; need 4096; done.
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:1953) XendDomainInfo.initDomain: 15 256
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:1994) _initDomain:shadow_memory=0x0, maxmem=0x200,
memory=0x200.
[2011-01-28 18:36:43 xend 2866] DEBUG (balloon:145) Balloon: 524396 KiB
free; need 524288; done.
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] ERROR
(XendDomainInfo:219) Domain construction failed
Traceback (most recent call last):
File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py",
line 212, in create
vm.initDomain()
File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py",
line 2019, in initDomain
channel_details = self.image.createImage()
File "/usr/lib64/python2.4/site-packages/xen/xend/image.py", line
122, in createImage
return self.createDomain()
File "/usr/lib64/python2.4/site-packages/xen/xend/image.py", line
130, in createDomain
if not os.path.isfile(self.kernel):
File "/usr/lib64/python2.4/posixpath.py", line 208, in isfile
st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:2189) XendDomainInfo.destroy: domid=15
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:2114) UUID Created: False
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:2115) Devices to release: [], domid = 15
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:2119) Releasing PVFB front-end devices (uuid not created)...
[2011-01-28 18:36:43 xend.XendDomainInfo 2866] DEBUG
(XendDomainInfo:2127) Releasing PVFB backend devices ...
[2011-01-28 18:36:43 xend 2866] ERROR (SrvBase:88) Request create failed.
Traceback (most recent call last):
File "/usr/lib64/python2.4/site-packages/xen/web/SrvBase.py", line
85, in perform
return op_method(op, req)
File
"/usr/lib64/python2.4/site-packages/xen/xend/server/SrvDomainDir.py",
line 82, in op_create
raise XendError("Error creating domain: " + str(ex))
XendError: Error creating domain: coercing to Unicode: need string or
buffer, NoneType found
/var/log/xend-debug.log shows:
Traceback (most recent call last):
File
"/usr/lib64/python2.4/site-packages/xen/xend/server/SrvDomainDir.py",
line 77, in op_create
dominfo = self.xd.domain_create(config)
File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomain.py",
line 243, in domain_create
dominfo = XendDomainInfo.create(config)
File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py",
line 212, in create
vm.initDomain()
File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py",
line 2019, in initDomain
channel_details = self.image.createImage()
File "/usr/lib64/python2.4/site-packages/xen/xend/image.py", line
122, in createImage
return self.createDomain()
File "/usr/lib64/python2.4/site-packages/xen/xend/image.py", line
130, in createDomain
if not os.path.isfile(self.kernel):
File "/usr/lib64/python2.4/posixpath.py", line 208, in isfile
st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
When I try to install guest vm directly from xen xm command there's no
problems ....
I try to solve this for two days, can't find anything that help me !
Client versions:
from rpm:
kernel-xen-2.6.18-194.32.1.el5
xen-libs-3.0.3-105.el5_5.5
xen-libs-3.0.3-105.el5_5.5
xen-3.0.3-105.el5_5.5
libvirt-python-0.6.3-33.el5_5.3
libvirt-0.6.3-33.el5_5.3
python-2.4.3-27.el5_5.3
libvirt-python-0.6.3-33.el5_5.3
koan-2.0.9-1.el5
from sources:
virtinst-0.500.5 (try with rpm version: same issue)
Cobbler server version:
cobbler-2.0.9-1.el5
cobbler-web-2.0.9-1.el5
What is wrong ? Anyone can help me to solve this ?
Thanks in advance.
Djill
13 years, 2 months
[ LDAP authorization ] : FAILED
by BONDOIN Remi
Hi,
I have install cobbler 2.0.9 on rhel 5.5.
I have some troubles with some LDAP user authorization :
--------------------------------------------------------------------------------------------------
Fri Jan 28 10:02:05 2011 - DEBUG | authorize; ['T0009097', 'modify_system', <cobbler.item_system.System instance at 0xa2d6cac>, None, 0]
Fri Jan 28 10:02:05 2011 - INFO | Exception occured: cobbler.cexceptions.CX
Fri Jan 28 10:02:05 2011 - INFO | Exception value: 'user T0009097 does not have access to resource: modify_system'
Fri Jan 28 10:02:05 2011 - INFO | Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 122, in die
raise CX(msg)
Fri Jan 28 10:02:05 2011 - INFO | Exception occured: cobbler.cexceptions.CX
Fri Jan 28 10:02:05 2011 - INFO | Exception value: 'user T0009097 does not have access to resource: modify_system'
Fri Jan 28 10:02:05 2011 - INFO | Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1535, in check_access_no_fail
self.check_access(token,resource,arg1,arg2)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1544, in check_access
rc = self.__authorize(token,resource,arg1,arg2)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1581, in __authorize
utils.die(self.logger, "user %s does not have access to resource: %s" % (user,resource))
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 130, in die
raise CX(msg)
-----------------------------------------------------------------------------------------------------
It works fine for lot of ldap user but failed for some of them.
I verify user ldap definition and find nothing bad ...
Does anyone has any idea ?
Best Regards
--
Ingénieur Systèmes Linux / Unix
THALES - Critical Information Systems
DIVISION Security Solutions & Services / Server Mgmt / Administration Systèmes
13 years, 2 months
What does the default_password_crypted field do?
by Joe Linoff
Hi Folks:
I recently decided to change the cobbler password and found that the
comment from "cobbler check" didn't really help. The comment said:
2 : The default password used by the sample templates for newly
installed machines
(default_password_crypted in /etc/cobbler/settings) is still set
to 'cobbler'
and should be changed, try:
"openssl passwd -1 -salt 'random-phrase-here'
'your-password-here'" to generate new one
So I ran:
% openssl passwd -1 'testit'
<value>
and cut-n-pasted the <value> to the "default_password_crypted:" field in
/etc/cobbler/settings and updated everything:
% service cobblerd restart
% cobbler sync
Unfortunately this didn't fix anything and I still couldn't log into the
web interface with the new password. Note that I also tried using a salt
but that didn't help either. I chose no salt for my initial test because
the default entry did not use a salt.
I finally got it to work using htdigest as follows:
% htdigest /etc/cobbler/users.digest "Cobbler" cobbler
New password: testit
Re-type new password: testit
% htdigest /etc/cobbler/users.digest "Cobbler" jlinoff
Adding user jlinoff in realm Cobbler
New password: testit1
Re-type new password: testit1
What does the default_password_crypted field do?
Best regards,
Joe
13 years, 2 months
Re: Snippet testing
by Robert Cross
Christian Horn wrote:
> - deploy virtual systems, similiar in the relevant aspects to the real
> systems. Used vmware in the past, nowadays kvm for this.
> Can be faster than deployment of real systems.
Unfortunately, I'm already doing this - that's why I wanted to use
cobbler - I've got VirtualBox pretty well automated, but provisioning
was a pain.
> - when making the snippets compatible with a newer version of cobbler
> (2.0.1 upwards got pickier about $variables that were not defined)
> one can also simply compare the generated ks-instructions:
>
> cobbler system getks --name=sakura>getks_old
>
> # then updating cobbler, modifying the snippets so newer cobbler
> # handles them
> cobbler system getks --name=sakura>getks_new
That's exactly what I was looking for - I obviously need to read the
documentation more carefully in future! ;) Thanks.
Unfortunately, I've now into another problem - rather than getting my
(carefully crafted?) snippets in the output kickstart I'm getting the
SNIPPET lines instead - the system is just echoing them into the file,
rather than processing them. Anyone got some idea what (simple?) step
I've missed out on? The web interface shows "my" snippets just fine, so
I don't think it's something like protections/ownerships/etc.
And I'm very sure that if kickstart comes across a line reading
"SNIPPET('zz_netpatch')" that it's going to fail. :(
Thanks, Bob.
13 years, 2 months
Snippet testing and doc updates
by Robert Cross
Two questions:
1. Is there a way to run a snippet against a system without having to
reinstall it? Reason I'm asking is because I want to generate some of
these to do various little tasks, (e.g. setup hosts, update up2date on
RHEL4), but want an easy way to test them (like I said, without having
to do an install each time).
2. If I spot areas where the documentation is less than 100%, what's the
correct way to report this - should it go to the dev list?
By the way, in closing, this is a great toolset - I can now provision my
RHEL/Centos images with the same ease as I can AIX5L with Network
Installation Manager (NIM), although Cobbler/Linux is a bit faster (just
over 5 minutes for the RHEL4-32bit VM on VirtualBox I did yesterday).
Cheers, Bob Cross.
13 years, 2 months
how do i restart a VM after aborting the boot
by Joe Linoff
Hi Folks:
How do I reboot a VM after an abort?
I started the VM using this command:
dom0 # koan --virt --nogfx --system=cws12-01
There was a bad package specified in my kickstart template so I aborted
the boot and fixed the kickstart.
I then tried to restart using:
dom0 # koan --virt --nogfx --system=cws12-01
but it failed with this message:
- looking for Cobbler at http://10.45.2.1/cobbler_api
- reading URL: http://10.45.2.1/cblr/svc/op/ks/system/cws12-01
install_tree: http://10.45.2.1/cblr/links/centos-5.5-xen-x86_64
libvirtd (pid 4962) is running...
downloading initrd initrd.img to /var/lib/xen/initrd.img
url=http://10.45.2.1/cobbler/images/centos-5.5-xen-x86_64/initrd.img
- reading URL:
http://10.45.2.1/cobbler/images/centos-5.5-xen-x86_64/initrd.img
downloading kernel vmlinuz to /var/lib/xen/vmlinuz
url=http://10.45.2.1/cobbler/images/centos-5.5-xen-x86_64/vmlinuz
- reading URL:
http://10.45.2.1/cobbler/images/centos-5.5-xen-x86_64/vmlinuz
Sat, 22 Jan 2011 16:38:25 DEBUG No conn passed to Guest, opening URI
'None'
exceptions.ValueError
Guest name 'cws12-01' is already in use.
File "/usr/lib/python2.4/site-packages/koan/app.py", line 225, in main
k.run()
File "/usr/lib/python2.4/site-packages/koan/app.py", line 356, in run
self.virt()
File "/usr/lib/python2.4/site-packages/koan/app.py", line 675, in
virt
return self.net_install(after_download)
File "/usr/lib/python2.4/site-packages/koan/app.py", line 594, in
net_install
after_download(self, profile_data)
File "/usr/lib/python2.4/site-packages/koan/app.py", line 673, in
after_download
self.virt_net_install(profile_data)
File "/usr/lib/python2.4/site-packages/koan/app.py", line 1157, in
virt_net_install
qemu_driver_type = self.qemu_disk_type
File "/usr/lib/python2.4/site-packages/koan/xencreate.py", line 113,
in start_install
guest.set_name(name)
File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 133,
in set_name
raise ValueError(_("Guest name '%s' is already in use.") % val)
I also tried:
dom0 # koan --virt --nogfx --system=cws12-01
but that didn't work.
What do I need to do to successfully reboot? Any hints would be greatly
appreciated.
Thanks,
Joe
13 years, 3 months