returncode of cobbler commandline operations always 0
by Christian Horn
Hi,
i try to add/delete/modify cobbler objects from a remote
box via ssh and discovered that returncodes are not even
local on the box i am executing the commands working:
$ cobbler system add --name=tester3 --hostname=tester3 \
> --mac=00 --profile=rhel5u5_serv-x86_64 --ip=10.0.22.40
cobbler.cexceptions.CX:'invalid format for MAC address (00)'
# echo $?
0
The behaviour is expected, thats no valid mac. Yet i
expected to get some returncode != 0. Same behaviour for
trying to a system-object with an invalid ip.
Not sure what i could have done wrong. Do i really have
to start querying/listing cobbler-objects to find out if
my last operation succeeded?
Christian
13 years, 9 months
koan error - Error: Multiple systems matched
by Tom Brown
Hi
As a long time cobbler user i have never come across this issue before
and google is not really helping and i cant seem to track down the
issue.
I would normally just issue a koan -r or koan -D and all would be well
but since yesterday i have been seeing the following
# koan -D
- looking for Cobbler at http://10.10.10.10/cobbler_api
Error: Multiple systems matched
I can work around it by specifying the system name but normally it
would be matched on mac address so i dont see why it has just started
failing. This mac in question is not duplicated
[root@spacewalk-server systems.d]# grep -i 0A:14:5A:47:68:49 *
clientname:1.json:{"comment": "", "kickstart": "<<inherit>>",
"name_servers_search": [], "ks_meta": {"orgid": "1", "hostname":
clientname", "role": "a-role"}, "kernel_options_post": {}, "image":
"", "redhat_management_key": "<<inherit>>", "virt_path":
"<<inherit>>", "power_user": "", "kernel_options": {"ksdevice":
"0A:14:5A:47:68:49"}, "name_servers": [], "mtime": 1280763353.0280659,
"template_files": {}, "gateway": "10.10.10.1", "uid":
"MTI4MDMzMTc4My43NDU3MjA1ODEuNzA0NDM", "power_type": "ipmitool",
"virt_cpus": "<<inherit>>", "hostname": "client-name", "mgmt_classes":
[], "power_pass": "", "netboot_enabled": true, "profile":
"CentOS-5.3-xen-x86_64", "virt_bridge": "<<inherit>>", "parent": "",
"virt_type": "<<inherit>>", "interfaces": {"eth0": {"dhcp_tag": "",
"subnet": "255.255.255.0", "virt_bridge": "", "static_routes": [],
"dns_name": "", "ip_address": "10.10.10.11", "bonding": "", "static":
true, "bonding_opts": "", "mac_address": "0A:14:5A:47:68:49",
"bonding_master": ""}}, "power_address": "", "virt_file_size":
"<<inherit>>", "ctime": 1280331783.7378111, "owners": ["admin"],
"name": "clientname:1", "virt_ram": "<<inherit>>", "power_id": "",
"random_id": "1rJ6", "server": "10.10.10.10",
"redhat_management_server": "10.10.10.10", "depth": 2}
Any clues here as some of my tools have now broken!!
thanks
13 years, 9 months
RE: partitioning
by Gavin Reid
Sorry my bad ... on the system the = in the heretoo's are - , should have proof read what I cut and paste!
probably should also cut it from the source and not the rendered view too so the escapes are in too oh well .
oh and thanks Joseph for posting your example in the first place ;)
# get the number of hard disks and there names
set \$(list-harddrives)
let numd=\$#/2
drive1=\$1
drive2=\$3
# Default data and rootvg size
swapsize=8192
pv2size=1
pv1size=8196
if [ \$numd = 1]; then # only one disk
cat <<- EOpart > /tmp/part-include
part /boot --fstype ext3 --size=100 --ondisk=\$d1 --asprimary
part pv.100 --size \$pv1size --ondisk=\$d1 --asprimary
part pv.200 --size \$pv2size --grow --ondisk=\$d1 --asprimary
volgroup rootvg pv.100
volgroup datavg pv.200
logvol / --fstype ext3 --vgname=rootvg --size=8196 --name=rootvol
logvol /tmp --fstype ext3 --vgname=rootvg --size=548 --name=tmpvol
logvol swap --fstype swap --vgname=rootvg --size=\$swapsize --name=swapvol
logvol /data --fstype ext3 --vgname datavg --size 1 --grow --name=nobackup
EOpart
else
cat <<- EOpart > /tmp/part-include
part /boot --fstype ext3 --size=100 --ondisk=\$d1 --asprimary
part pv.100 --size \$pv1size --ondisk=\$d1 --asprimary
part pv.200 --size \$pv2size --grow --ondisk=\$d2 --asprimary
part pv.300 --size 1 --grow --ondisk\$d1 --asprimary
volgroup rootvg pv.100
volgroup datavg pv.200 pv.300
logvol / --fstype ext3 --vgname=rootvg --size=8196 --name=rootvol
logvol /tmp --fstype ext3 --vgname=rootvg --size=548 --name=tmpvol
logvol swap --fstype swap --vgname=rootvg --size=\$swapsize --name=swapvol
logvol /data --fstype ext3 --vgname datavg --size 1 --grow --name=nobackup
EOpart
fi
13 years, 9 months
RE: partitioning
by Joseph Boyer Jr.
You also need to escape any variables that need to be determined when the scripts runs, also mentioned below
[cid:image001.png@01CB325B.1F73DA10]
Joseph Boyer Jr. | ETS Engineering | jboyer(a)liquidnet.com<mailto:jboyer@liquidnet.com> | +1 646.660.8352 | www.liquidnet.com<http://www.liquidnet.com/>
From: Joseph Boyer Jr.
Sent: Monday, August 02, 2010 3:51 PM
To: cobbler(a)lists.fedorahosted.org
Subject: RE: partitioning
It's a dash not an equals sign. The dash is means tabs to EOpart
i.e.
if [ \$numd = 1 ]; then #Physical Hardware
cat <<-EOpart > /tmp/part-include
part /boot --fstype ext3 --size=100 --ondisk=\$d1 --asprimary
part pv.100000 --size \$pv1size --ondisk=\$d1 --asprimary
part pv.200000 --size \$pv2size --grow --ondisk=\$d1 --asprimary
volgroup rootvg pv.100000
volgroup datavg pv.200000
logvol / --fstype ext3 --vgname=rootvg --size=4192 --name=rootvol
logvol /tmp --fstype ext3 --vgname=rootvg --size=548 --name=tmpvol
logvol /var --fstype ext3 --vgname=rootvg --size=2048 --name=varvol
logvol swap --fstype swap --vgname=rootvg --size=\$swapsize --name=swapvol
logvol /appdata/cores --fstype ext3 --vgname=datavg --size=25600 --name=corevol
logvol /appdata --fstype ext3 --vgname=datavg --size=1 --grow --name=appdatavol
EOpart
else
cat <<-EOpart > /tmp/part-include
part /boot --fstype ext3 --size=100
part pv.100000 --size \$pv1size --ondisk=\$d1 --asprimary
part pv.200000 --size \$pv2size --grow --ondisk=\$d2 --asprimary
volgroup rootvg pv.100000
volgroup datavg pv.200000
logvol / --fstype ext3 --vgname=rootvg --size=4192 --name=rootvol
logvol /tmp --fstype ext3 --vgname=rootvg --size=548 --name=tmpvol
logvol /var --fstype ext3 --vgname=rootvg --size=2048 --name=varvol
logvol swap --fstype swap --vgname=rootvg --size=\$swapsize --name=swapvol
logvol /appdata/cores --fstype ext3 --vgname=datavg --size=25600 --name=corevol
logvol /appdata --fstype ext3 --vgname=datavg --size=1 --grow --name=appdatavol
EOpart
[cid:image001.png@01CB325B.1F73DA10]
Joseph Boyer Jr. | ETS Engineering | jboyer(a)liquidnet.com<mailto:jboyer@liquidnet.com> | +1 646.660.8352 | www.liquidnet.com<http://www.liquidnet.com/>
From: cobbler-bounces(a)lists.fedorahosted.org [mailto:cobbler-bounces@lists.fedorahosted.org] On Behalf Of Gavin Reid
Sent: Monday, August 02, 2010 3:43 PM
To: cobbler(a)lists.fedorahosted.org
Subject: partitioning
Hi All , I am having problems with disk partitioning a section from my kickstart file follows
#get the number of hard disks and there names
set $(list-harddrives)
let numd=$#/2
drive1=$1
drive2=$3
# Default data and rootvg size
swapsize=8192
pv2size=1
pv1size=8196
if [ $numd = 1]; then # only one disk
cat <<=EOpart > /tmp/part-include
part /boot --fstype ext3 --size=100 --ondisk=$d1 --asprimary
part pv.100 --size $pv1size --ondisk=$d1 --asprimary
part pv.200 --size $pv2size --grow --ondisk=$d1 --asprimary
volgroup rootvg pv.100
volgroup datavg pv.200
logvol / --fstype ext3 --vgname=rootvg --size=8196 --name=rootvol
logvol /tmp --fstype ext3 --vgname=rootvg --size=548 --name=tmpvol
logvol swap --fstype swap --vgname=rootvg --size=$swapsize --name=swapvol
logvol /data --fstype ext3 --vgname datavg --size 1 --grow --name=nobackup
EOpart
else
cat <<=EOpart > /tmp/part-include
part /boot --fstype ext3 --size=100 --ondisk=$d1 --asprimary
part pv.100 --size $pv1size --ondisk=$d1 --asprimary
part pv.200 --size $pv2size --grow --ondisk=$d2 --asprimary
part pv.300 --size 1 --grow --ondisk$d1 --asprimary
volgroup rootvg pv.100
volgroup datavg pv.200 pv.300
logvol / --fstype ext3 --vgname=rootvg --size=8196 --name=rootvol
logvol /tmp --fstype ext3 --vgname=rootvg --size=548 --name=tmpvol
logvol swap --fstype swap --vgname=rootvg --size=$swapsize --name=swapvol
logvol /data --fstype ext3 --vgname datavg --size 1 --grow --name=nobackup
EOpart
fi
%include /tmp/part-include
yet the installer explodes at the include line ... it seem that the /tmp/part-include is not created ... any ideas or better methods of partitioning
13 years, 9 months