Wade Hampton wrote: > Thanks for the reply. > > On 7/18/07, Andrea Righi <[EMAIL PROTECTED]> wrote: >> Wade Hampton wrote: >> > G'day, >> > >> > I am trying to setup systemimager to allow me to re-image a remote box >> > so I don't have to fly to a location or get someone at the site run >> > the install. So far, I figured I could copy the kernel and initrd.img >> > to /boot on the box, add them to grub.conf as the default, type >> > reboot, and si reimages the box (really cool)! However, what I would >> > really like to do is have a simple way for the box to reload, reboot, >> > then come up with the same IP address it originally had, not DHCP. >> >> A solution could be to assign the IPs statically in /etc/dhcpd.conf, >> based on >> the mac address of the nodes (see `man si_mkdhcpserver` and `man >> si_mkdhcpstatic`). Otherwise simply write a custom post-install script to >> properly setup the IPs on all the interfaces of your clients (see >> http://svn.systemimager.org/listing.php?repname=systemimager&path=%2Ftrunk%2Fdoc%2Fexamples%2Fpost-install%2F&rev=0&sc=0 >> >> for some examples). >> >> > To prepare my box, I run a simple script that copies the initrd.img >> > and the kernel, then sets up grub.conf. This script could mount the >> > initrd and copy files to it such as the network settings.... How can >> > I get access to these settings as the post-install scripts run in a >> > chroot environment hence can't see the info on the initrd? Will I >> > have to hack the ramdisk init.d code to copy something or is there an >> > external method? >> >> I'm not sure to have understood your problem... could you reformulate >> it? which >> settings do you want/need to change? is it always referred to the >> static IPs >> issue? BTW network settings are defined in your image server (via DHCP >> or via >> installation parameters - see >> http://wiki.systemimager.org/index.php/Installation_Parameters). > > Basically, the box was previously setup with IP, network, netmask, > gateway. When I reimage the box, it would be nice to reuse the old > settings of the box without having to copy the MAC address to a file > or add to the DHCP server. To reimage my boxes, I run a simple script > that changes the grub.conf to point to the ramdisk/kernel from si, > then I type reboot. The next boot loads the ramdisk which then > reimages the box so I can remotely reimage the box. However, when the > box comes up after being reimaged, it would be nice if it came up with > the same IP address it originally had (prior to reimaging). I would > like to be able to wipe/reinstall a box from across the country via my > WAN.
In this case, if you can setup grub.conf, a solution could be to add the opportune installation parameters to the kernel command line. See: http://wiki.systemimager.org/index.php/Installation_Parameters The parameters you need should be the following: HOSTNAME=hostname DOMAINNAME=domainname DEVICE=ethi IPADDR=x.x.x.x NETMASK=x.x.x.x NETWORK=x.x.x.x BROADCAST=x.x.x.x GATEWAY=gateway Simply append them in your grub.conf in the "kernel" line (in a single line). >> >> If you want to access them as env variables in your post-install scripts >> source the file /tmp/variables.txt on the top of your scripts. > > Can I add my own variables to this file? Yes. >> >> > I am installing CentOS 5 using Systeminstaller 3.8.1. >> > >> > Also, I would like to mirror my systemimager server, but to a separate >> > network. The instructions expect the networks to be connected. What >> > directories would I need to copy >> > besides /var/lib/systemimager, /usr/share/systemimager, and /tftpboot? >> > >> >> Install the systemimager server packages in the mirror and simply use >> si_cpimage: >> >> mirror:~/# si_cpimage --server <orig_image_server> source_image >> destination_image > > That will work if they are on the same network or are connected. I > need to copy the image to a DVD then move it to the other, > non-connected network. > Unfortunately you can't use si_cpimage if your image servers are not connected to a network. So, to copy your image using a DVD you have to manually do the following steps: 1) copy your image to the mounted DVD: # cp -af /var/lib/systemimager/images/<your_image> /media/dvd/ 2) copy the rsync_stub: # cp -p /etc/systemimager/rsync_stubs/40<your_image> /media/dvd 3) umount the DVD and insert it in your mirror server 4) copy the image back to the mirror image server: # cp -af /media/dvd/<your_image> /var/lib/systemimager/images/ 5) copy the rsync_stub: # cp -p /media/dvd/40<your_image> /etc/systemimager/rsync_stubs 6) Re-create rsyncd.conf in the mirror server: # si_mkrsyncd_conf 7) create the default override: # mkdir /var/lib/systemimager/overrides/<your_image> 8) re-create the master autoinstall script: # si_mkautoinstallscript --image <your_image> --post-install reboot This should be fully implemented in si_cpimage in the future releases (I'm considering this a feature request). Regards, -Andrea ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ sisuite-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sisuite-users
