Solaris 10 zone configuration with sysidcfg and dhcp and hostname
807559Aug 18 2010 — edited Aug 20 2010Hi
Excuse me if I look like a n00b... it's probably because I'm a n00b.
I've been struggling in the dark for more than 2 days now and I'm wondering if I'm thinking about this all wrong...
I have stand-alone server where I need to run zones. I want to create zones and automagically configure them at boot (read: by running a script). So here's what I need...
A zone
starting from unconfigured state
whose hostname is not the same as the zone name
using corporate DHCP to get its IP address
with DNS config coming from the DHCP server
registering its address the DNS
with a preconfigured root password
(I don't own the corporate DHCP or DNS servers, I can't put my own DHCP or DNS servers on the network.)
I would lke to create the zone, throw some config at it, then boot the zone and walk away. I am using zones with exclusive-IP. I can construct the zones and manually configure them once they're started to have DHCP, my own name, registered IP address with DNS and everything else I have specified above. But I don't want to do it manually...
Sysidcfg seems to do some of what I want but not entirely.
In sysidcfg I can set the root_password, the primary interface using DHCP, DNS server. I can't set a hostname in sysidcfg AND use configure it for DHCP. So the hostname is not what I want it to be after the zone is started and ready to go. The DHCP server is providing the DNS configuration, Solaris does not seem to honour it, but i'll ignore that for the moment.
I have tried various combinations of using sysidcfg, /etc/nodename, /etc/hostname.+interface+ and /etc/dhcp.+interface+ but I can't find any combination that actually works.
I can write to the zonestorage/etc/nodename to set the nodename, that works. But it does not match the DHCP address, so I get prompted for a new name service because it can't find a DNS entry for the name.
I can write to the zonestorage/etc/hostname.+interface+ and /etc/dhcp.+interface+ (to get the system to register its name with the DNS server after getting its DHCP address) but then I get a system with no root password and no DNS configuration, even though they are set in the sysidcfg file.
I can write a script that gets part of the way using sysidcfg and /etc/... files, then boots the zone and then runs a bunch of voodoo via zlogin commands to fix all the stuff that couldn't be done 'properly', but that's not a 'boot and walk away' environment. I can write a script that uses sysidcfg and hacks around with other files in /etc (like nsswitch.conf, resolv.conf), but that just feels likes a dirty hack to fix something that wasn't done properly in the first place.
So where am I going wrong and how do I do it right (within the constraints defined)? Why can't I configure, boot and walk away?
Thanks