Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread Jonas Bygdén
On 2010-03-17 16:49, Philippe Eveque wrote:
 Hi,

 I'm not using spacewalk, just cobbler (rev 2.0.1)

 I have a system S with a profile P.

 in P there is a variable $var (defined as a kickstart metadata) 
 defined with value V1
 in S I override the $var with a different value : V2

 Then:

 cobbler profile getks --name=P
   = then $var value is V1

 whereas:

 cobbler system getks --name=S
= then $var value is V2


 So cobbler seem to be working as expected for me, that is
 get the profile ks when requested and the system profile when requested.



 Phil.
If you've read this thread you can see that this works for me as well, 
without problem.

The problem I DO have though is that, for some reason, the system is 
installed with the profile-ks instead of the system-ks - and I can't 
figure out why.

I have no idea where the determination is made to use a specific 
system-ks, what criteria is used to single out the system-ks from the 
profile-ks?

It's been 2 weeks since my initial question, and noone seems to be able 
to give me an answer to my questions.

/Jonas
___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread chandan dutta chowdhury
Hello,

Your system report shows that you are inheriting the profile kickstart

Am i missing something ?

Kickstart  : inherit




r...@spacewalk # cobbler system report --name=xenlinux21
Name   : xenLinux21
Comment:
Gateway: 192.168.33.1
Hostname   : xenLinux21.domain.net
Image  :
Kernel Options : {}
Kernel Options (Post Install)  : {}
Kickstart  : inherit
Kickstart Metadata : {}
Management Classes : []


- Chandan





On Mon, Mar 22, 2010 at 2:47 PM, Jonas Bygdén jonaslis...@gmail.com wrote:
 On 2010-03-17 16:49, Philippe Eveque wrote:
 Hi,

 I'm not using spacewalk, just cobbler (rev 2.0.1)

 I have a system S with a profile P.

 in P there is a variable $var (defined as a kickstart metadata)
 defined with value V1
 in S I override the $var with a different value : V2

 Then:

 cobbler profile getks --name=P
   = then $var value is V1

 whereas:

 cobbler system getks --name=S
    = then $var value is V2


 So cobbler seem to be working as expected for me, that is
 get the profile ks when requested and the system profile when requested.



 Phil.
 If you've read this thread you can see that this works for me as well,
 without problem.

 The problem I DO have though is that, for some reason, the system is
 installed with the profile-ks instead of the system-ks - and I can't
 figure out why.

 I have no idea where the determination is made to use a specific
 system-ks, what criteria is used to single out the system-ks from the
 profile-ks?

 It's been 2 weeks since my initial question, and noone seems to be able
 to give me an answer to my questions.

 /Jonas
 ___
 cobbler mailing list
 cobbler@lists.fedorahosted.org
 https://fedorahosted.org/mailman/listinfo/cobbler

___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread Jonas Bygdén
On 2010-03-22 12:10, chandan dutta chowdhury wrote:
 Hello,

 Your system report shows that you are inheriting the profile kickstart

 Am i missing something ?

 Kickstart  :inherit




 r...@spacewalk # cobbler system report --name=xenlinux21
 Name   : xenLinux21
 Comment:
 Gateway: 192.168.33.1
 Hostname   : xenLinux21.domain.net
 Image  :
 Kernel Options : {}
 Kernel Options (Post Install)  : {}
 Kickstart  :inherit
 Kickstart Metadata : {}
 Management Classes : []


 - Chandan

Excuse my ignorance, but what would it say if it were correct? I'm 
trying to figure out how the relationships between repos, distros, 
profiles and systems work and all I get is bits and pieces.

If this is supposed to be something else, then it's something that must 
have changed in the background when upgrading from 1.6 to 2.0 (well, if 
you read the whole thread you can see that I didn't just upgrade cobbler 
from 1.6 to 2.0, but I upgraded spacewalk from 0.6 to 0.8 - which 
included the cobbler upgrade), because I had it working before 
upgrading, and since the upgrade it's been like this.
___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread Philippe Eveque
2010/3/22 Jonas Bygdén jonaslis...@gmail.com

 On 2010-03-22 12:10, chandan dutta chowdhury wrote:
  Hello,
 
  Your system report shows that you are inheriting the profile kickstart
 
  Am i missing something ?
 
  Kickstart  :inherit
 
 
 
 
  r...@spacewalk # cobbler system report --name=xenlinux21
  Name   : xenLinux21
  Comment:
  Gateway: 192.168.33.1
  Hostname   : xenLinux21.domain.net
  Image  :
  Kernel Options : {}
  Kernel Options (Post Install)  : {}
  Kickstart  :inherit
  Kickstart Metadata : {}
  Management Classes : []
 
 
  - Chandan
 
 Excuse my ignorance, but what would it say if it were correct? I'm
 trying to figure out how the relationships between repos, distros,
 profiles and systems work and all I get is bits and pieces.


personnally
https://fedorahosted.org/cobbler/wiki/HowWeModelThings
and
https://fedorahosted.org/cobbler/attachment/wiki/ChartsAndGraphs/code.png
always helped figuring out the relationships.

the latter is a bit outdated I think.
But I guess you already went through it.
___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread Jonas Bygdén
On 2010-03-22 13:31, Philippe Eveque wrote:

 personnally
 https://fedorahosted.org/cobbler/wiki/HowWeModelThings
 and 
 https://fedorahosted.org/cobbler/attachment/wiki/ChartsAndGraphs/code.png
 always helped figuring out the relationships.

 the latter is a bit outdated I think.
 But I guess you already went through it.


Thanks Philippe,

Hadn't seen that first one, it made a couple of things more clear.

It didn't answer my question on what the variable 'Kickstart' is 
supposed to be to NOT just inherit the profile-ks, but actually use the 
system specific ks.

Right now ALL my registered systems have 'inherit' for the variable 
'Kickstart', some of which work as I want and some of which doesn't.

/Jonas
___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread Tom Brown
Thanks Philippe,


 Hadn't seen that first one, it made a couple of things more clear.

 It didn't answer my question on what the variable 'Kickstart' is
 supposed to be to NOT just inherit the profile-ks, but actually use the
 system specific ks.

 Right now ALL my registered systems have 'inherit' for the variable
 'Kickstart', some of which work as I want and some of which doesn't.




# cobbler profile edit --name=foo --kickstart=/path/to/ks

Then all systems in that profile will inherit that ks unless you override
that in the system

# cobbler system edit --name=bar --kickstart=/path/to/other/ks
___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread Jonas Bygdén

On 2010-03-22 14:26, Tom Brown wrote:

Thanks Philippe,


Hadn't seen that first one, it made a couple of things more clear.

It didn't answer my question on what the variable 'Kickstart' is
supposed to be to NOT just inherit the profile-ks, but actually
use the
system specific ks.

Right now ALL my registered systems have 'inherit' for the
variable
'Kickstart', some of which work as I want and some of which doesn't.



# cobbler profile edit --name=foo --kickstart=/path/to/ks

Then all systems in that profile will inherit that ks unless you 
override that in the system


# cobbler system edit --name=bar --kickstart=/path/to/other/ks


And where do I find the cobbler generated system-ks within my filesystem?

It does exist, since I get that using 'cobbler system getks 
--name={system name}', but I can't find it.


/Jonas
___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread Tom Brown
  And where do I find the cobbler generated system-ks within my filesystem?

 It does exist, since I get that using 'cobbler system getks --name={system
 name}', but I can't find it.




it does not exist on the filesystem - its generated on the fly by cobbler as
a rendered output from the ks template plus all your snippets
___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread Jonas Bygdén

On 2010-03-22 14:39, Tom Brown wrote:


And where do I find the cobbler generated system-ks within my
filesystem?

It does exist, since I get that using 'cobbler system getks
--name={system name}', but I can't find it.




it does not exist on the filesystem - its generated on the fly by 
cobbler as a rendered output from the ks template plus all your snippets


Exactly! So, why doesn't it use that when kickstarting? Where's the 
determination made? It can't be the 'Kickstart'-variable, since all my 
systems have the value 'inherit' here, and only some of the systems 
have the problem of getting the profile-ks instead of the system-ks.


/Jonas
___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread Tom Brown
Exactly! So, why doesn't it use that when kickstarting? Where's the
determination made? It can't be the 'Kickstart'-variable, since all my
systems have the value 'inherit' here, and only some of the systems have
the problem of getting the profile-ks instead of the system-ks.


then what is 'different' about those systems?


___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread Jonas Bygdén

On 2010-03-22 14:45, Tom Brown wrote:
Exactly! So, why doesn't it use that when kickstarting? Where's the 
determination made? It can't be the 'Kickstart'-variable, since all my 
systems have the value 'inherit' here, and only some of the 
systems have the problem of getting the profile-ks instead of the 
system-ks.



then what is 'different' about those systems?


They use a different profile (for xen, since they are virtual), that 
much I've figured out. This is the output of 'cobbler profile report' on 
two profiles, the first one causes the system to be installed with the 
profile-ks, and the second one causes the system to be installed with 
it's own system-ks:


r...@spacewalk # cobbler profile report 
--name=centos5-x86_64-xen:1:SpacewalkPublicCert

Name   : centos5-x86_64-xen:1:SpacewalkPublicCert
Comment:
DHCP Tag   : default
Distribution   : 
CentOs-5.3-x86_64-xen:xen:1:Spacewalk-Public-Cert

Enable PXE Menu?   : 1
Kernel Options : {}
Kernel Options (Post Install)  : {}
Kickstart  : 
/var/lib/rhn/kickstarts/wizard/centos53-x86_64-xen--1.cfg

Kickstart Metadata : {'org': 1}
Management Classes : []
Name Servers   : []
Name Servers Search Path   : []
Owners : ['admin']
Parent Profile :
Red Hat Management Key : 
1-e864f76fe07e3fef07dbf9457fb6bdf2,1-company_common

Red Hat Management Server  : inherit
Repos  : []
Server Override: inherit
Template Files : {}
Virt Auto Boot : 1
Virt Bridge: xenbr0
Virt CPUs  : 1
Virt File Size(GB) : 3
Virt Path  :
Virt RAM (MB)  : 512
Virt Type  : xenpv

r...@spacewalk # cobbler profile report 
--name=centos5-x86_64:1:SpacewalkPublicCert

Name   : centos5-x86_64:1:SpacewalkPublicCert
Comment:
DHCP Tag   : default
Distribution   : CentOs-5.3-x86_64:1:Spacewalk-Public-Cert
Enable PXE Menu?   : 1
Kernel Options : {}
Kernel Options (Post Install)  : {}
Kickstart  : 
/var/lib/rhn/kickstarts/wizard/centos5-x86_64--1.cfg

Kickstart Metadata : {'org': 1}
Management Classes : []
Name Servers   : []
Name Servers Search Path   : []
Owners : ['admin']
Parent Profile :
Red Hat Management Key : 
1-f7ec311e3f8aba149a205c9f7e58f2b9,1-company_common

Red Hat Management Server  : inherit
Repos  : []
Server Override: inherit
Template Files : {}
Virt Auto Boot : 1
Virt Bridge: xenbr0
Virt CPUs  : 1
Virt File Size(GB) : 3
Virt Path  :
Virt RAM (MB)  : 512
Virt Type  : qemu

Both of these profile-ks contains the 
'post_install_network_config'-snippet, but for some reason I get the 
profile-ks for the systems using the first profile and the system-ks for 
the systems using the second one.


/Jonas
___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Patch for dealing with standalone kernel options

2010-03-22 Thread Partha Aji

So basically in a kickstart profile/distro/system record if you set standalone 
kernel options as 

Kernel Options : {'vnc': '', 'vncpassword': 'foo'}

 the kickstart will get rendered as
/sbin/grubby --update-kernel=`/sbin/grubby --default-kernel` --args=vnc= 
vncpassword=foo
instead of 
/sbin/grubby --update-kernel=`/sbin/grubby --default-kernel` --args=vnc 
vncpassword=foo

(extra '=' after vnc). The attached patch resolves this issue. Originally this 
was reported as part of spacewalk 
https://bugzilla.redhat.com/show_bug.cgi?id=529277 and the investigation led to 
this cobbler issue and fix.

ParthaFrom 847b3c70cd8167a0c56adbba6474c6146801685c Mon Sep 17 00:00:00 2001
From: Partha Aji p...@redhat.com
Date: Mon, 22 Mar 2010 18:34:10 -0400
Subject: Fix for spacewalk bug 529277

---
 cobbler/utils.py |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cobbler/utils.py b/cobbler/utils.py
index 4dedbf8..1572906 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -820,7 +820,7 @@ def hash_to_string(hash):
return hash
 for key in hash:
value = hash[key]
-   if value is None:
+   if not value:
buffer = buffer + str(key) +  
elif isinstance(value, list):
# this value is an array, so we print out every
-- 
1.6.6.1

___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler


Re: Getting 'profile-kickstart' instead of 'system-kickstart'

2010-03-22 Thread chandan dutta chowdhury
On Mon, Mar 22, 2010 at 7:29 PM, Jonas Bygdén jonaslis...@gmail.com wrote:
 On 2010-03-22 14:45, Tom Brown wrote:

 Exactly! So, why doesn't it use that when kickstarting? Where's the
 determination made? It can't be the 'Kickstart'-variable, since all my
 systems have the value 'inherit' here, and only some of the systems have
 the problem of getting the profile-ks instead of the system-ks.


 then what is 'different' about those systems?

 They use a different profile (for xen, since they are virtual), that much
 I've figured out. This is the output of 'cobbler profile report' on two
 profiles, the first one causes the system to be installed with the
 profile-ks, and the second one causes the system to be installed with it's
 own system-ks:

 r...@spacewalk # cobbler profile report
 --name=centos5-x86_64-xen:1:SpacewalkPublicCert
 Name   : centos5-x86_64-xen:1:SpacewalkPublicCert
 Comment    :
 DHCP Tag   : default
 Distribution   :
 CentOs-5.3-x86_64-xen:xen:1:Spacewalk-Public-Cert
 Enable PXE Menu?   : 1
 Kernel Options : {}
 Kernel Options (Post Install)  : {}
 Kickstart  :
 /var/lib/rhn/kickstarts/wizard/centos53-x86_64-xen--1.cfg
 Kickstart Metadata : {'org': 1}
 Management Classes : []
 Name Servers   : []
 Name Servers Search Path   : []
 Owners : ['admin']
 Parent Profile :
 Red Hat Management Key :
 1-e864f76fe07e3fef07dbf9457fb6bdf2,1-company_common
 Red Hat Management Server  : inherit
 Repos  : []
 Server Override    : inherit
 Template Files : {}
 Virt Auto Boot : 1
 Virt Bridge    : xenbr0
 Virt CPUs  : 1
 Virt File Size(GB) : 3
 Virt Path  :
 Virt RAM (MB)  : 512
 Virt Type  : xenpv

 r...@spacewalk # cobbler profile report
 --name=centos5-x86_64:1:SpacewalkPublicCert
 Name   : centos5-x86_64:1:SpacewalkPublicCert
 Comment    :
 DHCP Tag   : default
 Distribution   : CentOs-5.3-x86_64:1:Spacewalk-Public-Cert
 Enable PXE Menu?   : 1
 Kernel Options : {}
 Kernel Options (Post Install)  : {}
 Kickstart  :
 /var/lib/rhn/kickstarts/wizard/centos5-x86_64--1.cfg
 Kickstart Metadata : {'org': 1}
 Management Classes : []
 Name Servers   : []
 Name Servers Search Path   : []
 Owners : ['admin']
 Parent Profile :
 Red Hat Management Key :
 1-f7ec311e3f8aba149a205c9f7e58f2b9,1-company_common
 Red Hat Management Server  : inherit
 Repos  : []
 Server Override    : inherit
 Template Files : {}
 Virt Auto Boot : 1
 Virt Bridge    : xenbr0
 Virt CPUs  : 1
 Virt File Size(GB) : 3
 Virt Path  :
 Virt RAM (MB)  : 512
 Virt Type  : qemu

 Both of these profile-ks contains the 'post_install_network_config'-snippet,
 but for some reason I get the profile-ks for the systems using the first
 profile and the system-ks for the systems using the second one.

 /Jonas



Sorry looks like I really missed something. The logic for
inclusion/exclusion of the post_install_network_config is part of the
post_install_network_config snippet itself.

The first line in the post_install_network_config snippet tries to
determine if the kickstart is generated for a profile or a system.

#if $getVar(system_name,) !=  (see
http://git.fedoraproject.org/git/cobbler/?p=cobbler;a=blob;f=snippets/post_install_network_config;h=83640122bdab9e6158ff5cf1aaf0e3dcf2a3dc88;hb=HEAD)

In case it is a system the network configuration snippet is included
and not for profile.
So your kickstart setting inherit is correct.

Based on the info you provided it looks like the above mentioned  if
condition is failing for you for system which are not getting the
snippet. Just a pointer for you to debug,

How this is related to spacewalk i am not sure as i have no experience
of spacewalk or xen with cobbler.

This is all i can guess at the moment

- Chandan
___
cobbler mailing list
cobbler@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler