summaryrefslogtreecommitdiffstats
path: root/website/new/docs/cobbler-import.html
blob: 500087e2cfd3e37cadb6880081da807f8371e78b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<a name="toc">
<h2>Cobbler Import</h2>
</a>

<a name="import">
<h2>About</h2>
<p>
Suppose you want to set up a network boot server for a given distro, really really quickly. For this example, we'll use Fedora Core 6 as an example. What's the best way to do this? It's a command called "cobbler import", that can mirror content based on a DVD image, a tree on a filesystem, or even an external rsync mirror or SSH location.
</p>

<a name="provserver">
<h2>Setting Up A Provisioning Server From Scratch</h2>
</a>
<p>
<blockquote>
<ul>
<li>yum install cobbler</li>
<li>cobbler check</li>
<li>/var/lib/cobbler/settings for 'server' and 'next-server' addresses</li>
<li>Download the FC6 DVD image and mount it, either with a real CD or a loopback</li>
<li>cobbler import --mirror=/media/dvd --name=FC-6</li>
<li>cobbler sync</li>
</ul>
</blockquote>
<p>
You're done.  Really.
</p>
<p>
Alternatively, you could have also used:
</p>
<blockquote>
cobbler import --mirror=rsync://servergoeshere/path/to/distro --name=FC-6
</blockquote>
<p>
This would mirror from a public rsync server without needing the DVD image.
</p>
<p>
The kickstarts used above will provision machines with a default password of "cobbler" and a really basic set of packages. For something more complicated, you may wish to edit the default kickstarts in /etc/cobbler and then re-run "cobbler sync" to apply those changes.
</p>
<p>
What if you don't want to mirror the content?  Say you already have the trees from all your DVDs and/or CDs extracted on a Filer mounted over NFS somewhere.  This works too, with the addition of one more argument, in versions 0.5.3 and later...
</p>
<p>
<blockquote>
cobbler import --mirror=/path/where/filer/is/mounted --name=filer --available-as=nfs://nfsserver.example.org:/is/mounted/here
</blockquote>
</p>
<p>
The above command will set up cobbler automatically using all of the above distros (stored on the filer) as a basis -- but will keep the trees on NFS.  This saves disk space on the Cobbler server.  As you add more distros over time to the filer, you can keep running the above commands to add them to Cobbler.  So, whether using some data you already have on the network, or letting cobbler create an install mirror for you, there are lots of useful options.  </p>

<a name="#reinstalls">
<h2>Using That Server For Reinstallation</h2>
</a>
<p>
Should you have a system you want to install that FC-6 on (instead of whatever it is running now), right now, you can do this:
</p>
<blockquote>
<ul>
<li>yum install koan</li>
<li>koan --server=bootserver.example.com --list-profiles</li>
<li>koan --replace-self --server=bootserver.example.com --profile=FC-6</li>
<li>/sbin/reboot</li>
</ul>
</blockquote>
<p>
The system will install the new operating system after rebooting, hands off, no interaction required.
</p>

<a name="#virt">
<h2>Using That Server For Virtualization</h2>
<p>
Want to install a xen guest instead? No problem.
</p>
<p>
<blockquote>
  <ul>
  <li>yum install koan</li>
  <li>koan --virt --server=bootserver.example.com --profile=FC-6-xen</li>
  </ul>
</blockquote>
<p>
Done.
</p>

<a name="#pxe">
<h2>Using That Server For PXE</h2>
<p>
Note that so far we've only mentioned reinstalling and doing virtualized installs. PXE is easy too. If you want PXE, you have two options. If you want to run dhcp locally, just set manage_dhcp to 1 in /var/lib/cobbler/settings on the boot server, edit /etc/dhcp.template to change some defaults, and re run "cobbler sync". You're good. Cobbler will keep track of your dhcp files for you, and you'll never have to hand edit them.  <a href="./cobbler-dhcp.php">Read more about DHCP management here</A>.
</p>
<p>
If the dhcp server is somewhere else, you can get your dhcp server admin to point at your box as a "next-server". Easy enough.
</p>
<p>
Once you get PXE set up, all of the profiles will, by name, show up in PXE menus when the machines network boot. Type "menu" at the prompt and choose one from the list. Or just don't do anything and the machine will default through to local booting.  
<blockquote>
Tip: if you're using RHEL4, install the latest syslinux to enable the PXE menu support. 
</blockquote>
</p>
<p>
Should you want to pin a particular system to a particular profile, just run:
</p>
<blockquote>
cobbler system add --name=$mac-address --profile=$profile-name
</blockquote>
<p>
Then the above machine will boot directly to the profile of choice without bringing up the menu.  Don't forget to read the manpage docs as there are more options for customization and control available.
</p>