[devel] fire in the hole and other metaphors
by Michael DeHaan
I'm finally getting a good plan of where the SQL work will go, but if
you are working on patches on the development branch, I /GREATLY/
appreciate you, but you may want to hold any development work for a week
or two for your own sanity -- things are changing a lot and these things
are rather intrusive; things won't be mergeable.
I promise the resulting code will be even easier to understand and work
on than before. This cleanup is long overdue and now is the time to
do it.
APIs will remain 99% compatible (calls like deserialize are going away,
but nothing else). More APIs may likely be added.
Upgrade compatiblity /will/ be preserved.
Thanks!
--Michael
15 years, 5 months
Default profile
by Scott McClanahan
How do I keep the default profile from being created during an import?
As a post trigger I create the profiles that I want and would prefer
that the default profile not be created. For instance, something like:
cobbler import --name=CentOS-5_2 --arch=x86
--path=rsync://foo.com/5.2/os/i386
causes a default profile of CentOS-5_2-i386 to be created and I'd rather
it didn't. Thanks.
-scott
15 years, 5 months
Migrating from 1.2.x -> 1.4.x
by Chris O'Regan
I am getting ready to upgrade to 1.4.x and I would like to confirm my
upgrade procedure.
I have a pair of systems that I am using for Cobbler. My intention is to
perform a clean install of 1.4.x on the secondary, configure and then
sync the data from the 1.2.x (primary) server. Then I will do the same
on the primary. Does this sound reasonable?
Chris
15 years, 5 months
Bugs in cobbler 1.4.x
by Steven Wagner
I couldn't see a way of creating a ticket in Trac, so I'll just kick it
old-school and whine about my problems on the mailing list. Apologies if
this message comes out weirdly-formatted, as I've just changed e-mail
clients.
I've noticed some peculiar behaviors in Cobbler 1.4.x after upgrading from
1.3.4 to 1.4.0, and then to 1.4.1 soon after. I'm currently running
1.4.1-1, built from Michael's source RPM.
* Template processing for my ISC dhcpd template went from taking about 30-40
seconds to over two and a half minutes (according to time). I'm basically
walking through the DHCP tags and outputting host lines based on that, with
liberal application of the #slurp template command to keep everything on one
line but still keep the template readable. I'm a relative cheetah newbie so
I could just be doing something horribly inefficient here. But still, it
took 30 seconds in 1.3.x and now it's taking four or five times longer in
1.4.x, so I'm going to report it as a bug...
* Cobbler seems to have trouble processing the "<<inherit>>" keyword. This
is torpedoing kickstarts, as the Kickstart Server system variable is
seemingly being overwritten by the Kickstart Server *profile* variable, when
it's set to "<<inherit>>". That's something I don't remember doing. Could
there be some broken logic in the conversion from my 1.3.4 datafiles to
1.4.0 to 1.4.1?
* Most troublingly of all, I am having trouble adding systems under certain
circumstances in the web interface. It seems that the more data I enter at
a time, the more likely I am to put cobbler into an infinite recursion as it
tries to validate my form data. This manifests as "Error saving system,"
though I can see the (very long) exception in the cobbler daemon's logfile.
An extremely sad side effect of this is that it throws this exception
*after* it truncates the system config file for writing, but before any data
is written to it. In other words, editing or creating/copying a system
object is randomly resulting in system object data being completely
clobbered! At a minimum, I would suggest that future versions of cobbler
write changes to a temporary file or deal with this scenario in an exception
handler.
If there's a formal Cobbler bug process I need to follow to file these,
point me to it and I'll jam in as much information as I can on these
subjects. Otherwise I'm happy to hash it out in email or here on the
list...
15 years, 5 months
Koan: errors when building RPM from source RPM
by James Cammarata
Just grabbed the source RPMs for 1.4.1-1 from
http://people.fedoraproject.org/~mdehaan/files/cobbler/, and while doing a
rpmbuild on the koan spec file, I saw this:
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/opt_parse.py
to opt_parse.pyc
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/imagecreate.py
to imagecreate.pyc
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/qcreate.py
to qcreate.pyc
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/vmwwcreate.py
to vmwwcreate.pyc
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/vmwcreate.py
to vmwcreate.pyc
File "/usr/lib/python2.4/site-packages/koan/vmwcreate.py", line 124
<<<<<<< HEAD:koan/vmwcreate.py
^
SyntaxError: invalid syntax
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/__init__.py
to __init__.pyc
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/app.py
to app.pyc
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/utils.py
to utils.pyc
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/xencreate.py
to xencreate.pyc
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/text_wrap.py
to text_wrap.pyc
byte-compiling
/var/tmp/koan-1.4.1-1-buildroot/usr/lib/python2.4/site-packages/koan/sub_process.py
to sub_process.pyc
writing byte-compilation script '/tmp/tmpDw-Xsu.py'
/usr/bin/python -O /tmp/tmpDw-Xsu.py
File "/usr/lib/python2.4/site-packages/koan/vmwcreate.py", line 124
<<<<<<< HEAD:koan/vmwcreate.py
^
SyntaxError: invalid syntax
Looks like a merge-conflicted file made it into the release.
James Cammarata
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
15 years, 5 months
[devel] sqlite indexes vs the full-on database
by Michael DeHaan
One of the things we've talked about a fair amount here is whether
cobbler should have a database backed serializer. This particularly
comes up when we want to thing about having 10,000 systems in Cobbler,
or even 1000 distros (for test projects like Beaker).
It terms out there are advantages and disadvantages to each route:
-- Text-based (in this case serializer_catalog)
* easily debuggable and hand-editable
* works great with rsync and cp and standard tools
* files can be put into version control
* schema upgrades 'just work'
Database:
* infinitely faster for searching and interation
I'm thinking (as I've discussed with some of you on IRC) we really don't
have to choose the full database route. If we do, troubleshooting
becomes a pain and a lot of the things we really like to be able to do
(copy system definitions around) don't work so well.
So, the plan is to see if we can't instead just build a sqlite
(sqlalchemy powered, actually) lookup index.
Then we modify the cobbler code to use this index for most find calls,
and only the obscure CLI/webapp search requests will need to comb
thorugh the actual objects.
We also change the interations through the cobbler objects/code to use
the database index where possible and only load the objects when
something other than the name needs to be queried.
This should be very efficient -- we can probably get away with making
getattr() magic proxy objects that deserialize objects on demand so for
the most part API consumers may not have to know about things.
Doing this, I think we can get the performance we want without having to
give up the very cool "auto upgrade" logic that is in Cobbler today.
It also ensures we don't have to write a cobbler yaml-to-database upgrader.
I'm going to be exploring this over the next week or so to see what
benefits we can gain.
One thing though -- if anyone is depending on the get_distros(),
get_systems() types of API calls in the remote interface to return
anything more than just the names of the objects, please stop relying on
them -- if we're going to make these fast, we need to make sure object
data is only accessed on demand, so "give me all your system records" is
pretty inefficient. The webapp can manage this by paginating it's calls
(and does), though other consumers need to take this into account when
making things scalable.
Ideally we'll have get_system_names in the API in the future and start
looking to deprecate get_systems() ... initially it might just return
[ {"name":"one"}, {"name":"two"} ], etc.
More details TBD as I explore further...
--Michael
15 years, 5 months
Disconnections with reposync
by Joshua Baldock
Hi Guys,
Im hoping you can help me. I have my Cobbler server sitting behind our companies ISA proxy server. When doing cobbler reposync after a period of time downloading packages I get the following error:-
Traceback (most recent call last):
File "/usr/bin/reposync", line 264, in ?
main()
File "/usr/bin/reposync", line 245, in main
path = repo.getPackage(pkg)
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 652, in getPackage
cache=cache
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 635, in _getFile
raise Errors.NoMoreMirrorsRepoError, errstr
yum.Errors.NoMoreMirrorsRepoError: failure: nagios-plugins-oracle-1.4.6-3.el4.x86_64.rpm from EL4-updates: [Errno 256] No more mirrors to try.
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/cobbler/action_reposync.py", line 105, in run
self.sync(repo)
File "/usr/lib/python2.4/site-packages/cobbler/action_reposync.py", line 136, in sync
return self.yum_sync(repo)
File "/usr/lib/python2.4/site-packages/cobbler/action_reposync.py", line 346, in yum_sync
raise CX(_("cobbler reposync failed"))
CX: 'cobbler reposync failed'
- reposync failed, tries left: 0
reposync failed, retry limit reached, aborting
In checking with our Windows Admin's the ISA proxy is blocking the connection after a while due to the following reason:-
"A connection was rejected because the connection limit specifying the maximum number of connections that can be created for a rule during one second was exceeded."
I have been told this threshold on the ISA Server is 1000 connections a second.
Would like to know if anyone has had this type of problem before? And if there Is anything I can do on the cobbler server, as the Win Admins aren't willing to change the ISA Server settings.
Cheers,
Josh
________________________________
Information contained in this communication (including any attachments) is confidential and may be privileged or subject to copyright. If you have received this communication in error you are not authorised to use the information in any way and Optiver requests that you notify the sender by return email, destroy all copies and delete the information from your system. Optiver does not represent, warrant or guarantee that this communication is free from computer viruses or other defects or that the integrity of this communication has been maintained. Any views expressed in this communication are those of the individual sender. Optiver does not accept liability for any loss or damage caused directly or indirectly by this communication or its use.
Please consider the environment before printing this email.
15 years, 5 months
XMLRPC definitions
by Eric Raymond
Hello All,
I am working on building a "live agent" to tie into Cobbler. Essentially, a
new system is powered on, automatically PXE boots with this live agent, and
would register itself to Cobbler, at which point a person can select the
profile, and add in the customizations for ksmeta, and then reboot to be
installed.
My problem is that I can't seem to find the proper object name for adding
the mac address when registering the server. I get the error:
xmlrpclib.Fault: <Fault 1: "<class 'cobbler.cexceptions.CX'>:'object has no
method: mac_address'">
The code snippet is:
def registerSelf():
mac = commands.getoutput("ifconfig eth0 | grep HWaddr | awk {'print
$5'}")
mem = commands.getoutput("cat /proc/meminfo | grep MemTotal | awk
{'print $2 $3'}")
cpu = commands.getoutput("cat /proc/cpuinfo | grep 'model name' | uniq |
cut -f1,2 | awk {'print $0'}")
numproc = commands.getoutput("cat /proc/cpuinfo | grep 'processor' |
uniq ")
print "MAC: %s" % mac
print "Memory: %s" % mem
print "CPU: %s" % cpu
object = server.new_system(token)
server.modify_system(object, "name", mac, token)
server.modify_system(object, "profile", "Registration", token)
server.modify_system(object, "mac_address", mac, token)
result = server.save_system(object, token)
I am trying to find where in the remote.py or any of the packages that has
the correct naming for the model, so any help would be greatly appreciated.
Thanks,
Eric
15 years, 5 months
one more for power
by Bill Peck
I found one more file that has power defined in it.
>From 37cf4074633714c7747271b06637b07c4842f9e5 Mon Sep 17 00:00:00 2001
From: Bill Peck <bpeck(a)redhat.com>
Date: Tue, 13 Jan 2009 15:38:51 -0500
Subject: [PATCH] Added integrity to system_power template
---
webui_templates/system_power.tmpl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/webui_templates/system_power.tmpl b/webui_templates/system_power.tmpl
index 9f0011e..c955ad4 100644
--- a/webui_templates/system_power.tmpl
+++ b/webui_templates/system_power.tmpl
@@ -39,7 +39,7 @@ function submit_power(value)
</td>
<td>
- #set valid_power = [ "none", "bullpap", "wti", "apc_snmp", "ether-wake", "ipmilan", "drac", "ipmitool", "ilo", "rsa", "lpar", "bladecenter" ]
+ #set valid_power = [ "none", "bullpap", "wti", "apc_snmp", "ether-wake", "ipmilan", "drac", "ipmitool", "ilo", "rsa", "lpar", "bladecenter", "integrity" ]
#set nothing = valid_power.sort()
#for $value in $valid_power:
#if $system and (($system.power_type == $value) or ($system.power_type == "" and $value == "none"))
--
1.6.0.6
15 years, 5 months
[PATCH] Fixed tests for image handling, and cleaned up image parsing.
by Darryl L. Pierce
NOTE: this patch only contains a better description than the previous.
This patch includes more examples of valid and invalid image URLs and
ensures that the image processing handles them correctly.
Signed-off-by: Darryl L. Pierce <dpierce(a)redhat.com>
---
cobbler/item_image.py | 21 ++++++++++++++-------
cobbler/test_basic.py | 11 +++++++++--
2 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/cobbler/item_image.py b/cobbler/item_image.py
index b11dc9c..5a4123b 100644
--- a/cobbler/item_image.py
+++ b/cobbler/item_image.py
@@ -119,26 +119,33 @@ class Image(item.Item):
* hostname:/path/to/the/filename.ext
* /path/to/the/filename.ext
"""
- print "STARTING WITH FILENAME: %s" % filename
uri = ""
- auth = hostname = path = ""
+ scheme = auth = hostname = path = ""
# we'll discard the protocol if it's supplied, for legacy support
if filename.find("://") != -1:
- ignored, uri = filename.split("://")
+ scheme, uri = filename.split("://")
filename = uri
else:
uri = filename
if filename.find("@") != -1:
auth, filename = filename.split("@")
+ # extract the hostname
+ # 1. if we have a colon, then everything before it is a hostname
+ # 2. if we don't have a colon, then check if we had a scheme; if
+ # we did, then grab all before the first forward slash as the
+ # hostname; otherwise, we've got a bad file
if filename.find(":") != -1:
hostname, filename = filename.split(":")
elif filename[0] != '/':
- index = filename.find("/")
- hostname = filename[:index]
- filename = filename[index:]
+ if len(scheme) > 0:
+ index = filename.find("/")
+ hostname = filename[:index]
+ filename = filename[index:]
+ else:
+ raise CX(_("invalid file: %s" % filename))
# raise an exception if we don't have a valid path
- if filename[0] != '/':
+ if len(filename) > 0 and filename[0] != '/':
raise CX(_("file contains an invalid path: %s" % filename))
if filename.find("/") != -1:
path, filename = filename.rsplit("/", 1)
diff --git a/cobbler/test_basic.py b/cobbler/test_basic.py
index 7f6a062..27ecabe 100644
--- a/cobbler/test_basic.py
+++ b/cobbler/test_basic.py
@@ -873,8 +873,15 @@ class TestImage(BootTest):
# ensure that only valid names are accepted and invalid ones are rejected
image = self.api.new_image()
self.assertTrue(image.set_file("nfs://hostname/path/to/filename.iso"))
- self.assertTrue(image.set_file("/mcpierce@hostname:/path/to/filename.iso"))
- self.assertTrue(image.set_file("path/to/filename.iso"))
+ self.assertTrue(image.set_file("nfs://mcpierce@hostname:/path/to/filename.iso"))
+ self.assertTrue(image.set_file("nfs://hostname:/path/to/filename.iso"))
+ self.assertTrue(image.set_file("nfs://hostname/filename.iso"))
+ self.assertTrue(image.set_file("hostname:/path/to/the/filename.iso"))
+ self.failUnlessRaises(CX, image.set_file, "hostname:filename.iso")
+ self.failUnlessRaises(CX, image.set_file, "path/to/filename.iso")
+ self.failUnlessRaises(CX, image.set_file, "hostname:")
+ # port is not allowed
+ self.failUnlessRaises(CX, image.set_file, "nfs://hostname:1234/path/to/the/filename.iso")
#class TestCLIBasic(BootTest):
#
--
1.6.0.6
15 years, 5 months