On 02/22/2016 04:05 AM, Fred Liu wrote:
From: Nahum Shalman [mailto:[email protected]]
Sent: 星期五, 二月 19, 2016 21:55
To: [email protected]
Subject: Re: [smartos-discuss] enable network/physical in noinstall/recovery?

If you know the mac address of the NIC you want to bring online, you can edit 
the kernel command line within grub and append the following stuff:

,admin_mac=11:22:33:44:55:66,admin_ip=dhcp
or
,admin_mac=11:22:33:44:55:66,admin_ip=192.168.x.y,admin_netmask=255.255.255.0,admin_gateway=192.168.x.1

[Fred]: I tried. It seems it did not work.

That's what I get for doing things from memory. it's "admin_nic" not admin_mac... Sorry about that.


If you can't edit the kernel command line, the alternative to getting the system to finish coming 
up is to manually create the /usbkey directory, and create a minimal /usbkey/config file with the 
networking configuration you want. After that "sysinfo -f" then "svcadm clear 
network/physical" and the system should finish bringing services online.

You'll probably need to fix up /etc/resolv.conf if you want to make outbound 
connections.

[Fred]: It works well!

Good.

Be aware that you're bringing the machine online with a known root password 
that will work over SSH. You can replace the hash in the kernel command line 
with something else if you want to be extra cautious.

I hope that helps.

[Fred]: Are there comprehensive documents about all the parameters fed to 
kernel? Could the alternative way be
         Adding ",smartos=false,noimport=true" to the normal boot kernel?

To answer your original question about why there isn't a rescue mode that 
includes networking, I think the main reasons are:
1. SmartOS is often used on machines with multiple NICs. There's no way to know 
which to use without more information from the operator.
2. SmartOS is often used on networks with no DHCP server. Without being told 
what IP address to use there would be no way for SmartOS to configure working 
networking.
3. The system would then come online with a known root password and SSH running 
and that could be dangerous.
4. In light of those other reasons, no one has written code for it.

[Fred]: Hmmmmm, what is your way to restore a bad zpool like zones?

I've rarely had issues that I couldn't clear up with a few commands directly at the console. Most of my machines either have IPMI (which I can use for serial-over-lan) or are plugged into an IP KVM so I've generally not needed to have networking come up in rescue mode.

When I do need a machine to come up with networking in rescue mode I use one of the two above methods. I usually use the manual creation of /usbkey/config because I don't have the MAC address handy until after I've logged in. I suppose it could be nice to write a script that would take a named interface like "igb0" that could automate bringing networking up, but it's so rare that I need rescue mode that I haven't felt the need to automate it.

-Nahum


-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com

Reply via email to