On 10/01/2015 06:20 PM, Dirk Steinberg wrote:
Hi,

I am currently thinking about locally preparing a SmartOS disk image
by installing to a disk following the procedure outlined in

https://wiki.smartos.org/display/DOC/Installing+Joyent+SmartOS+onto+a+Bootable+Disk+Partition

I'm guilty of having written the current version of that document as well...

I would probably do this in VMware Fusion.

Then I want to deploy this disk image to a physical server that I rented (kimsufi).
On that server I do not have a remote console and only a single disk,
no USB stick or anything else. The only remote access is via SSH when
the system is running.

I know this sounds strange, but I have my reasons. The SmartOS version
that OVH/kimsufi is offering is too old for my purposes and the netboot
environment they are offering cannot be upgraded/modified by the user.
Therefore I need to install to the physical disk.

As long as you acknowledge that this is not how SmartOS is intended to be used, and as long as I put my caveat that while I'm helping explain how to do this it's not technically a supported way to use SmartOS we can continue on with ab^W^Wusing SmartOS is ways that the developers never intended even though it's quite good for them.

Netbooting the Linux rescue system would allow me to remotely overwrite
the physical disk with my prepared image. The plan is to prepare a
small image to start with and expand that later to the size of the entire physical
disk. Although the GPT label and the zones pool from the image would be
much smaller than the real disk size initially, I read somewhere the
SmartOS/ZFS supports growing LUNs in operation. While my case
isn’t exactly a LUN on a SAN that grows, the same concept should be
applicable here.

What do I need to do to trigger the growing of the pool (including the GPT label)?

Should be as simple as:
    zpool online -e zones <disk identifier>

If you happen to know that it will always be e.g. c1t0d0 you could hardcode...
    zpool online -e zones c1t0d0


From the zpool(1m) man page:

       zpool online [-e] pool device...
           Brings the specified physical device online.

           This command is not applicable to spares or cache devices.

           -e
Expand the device to use all available space. If the device
                 is part of a mirror or raidz then all devices must be
                 expanded before the new space will become available to the
                 pool.



Will the GRUB boot code still function even if the disk geometry is different on the
target disk? I believe it should work if LBA addressing is used.

Test and report back! At worst you could probably make sure to ship the grub binary and re-install grub after you expand the pool...

I think I need to configure both the MAC address and the IP address to match that for my target system, as well as the default route. That should not be a
problem, all these parameters are known. Could I also use DHCP for the
global zone? I think kimsufi supports DHCP.

Do I need to configure the ethernet device name somewhere (e1000g0)?
My current understanding is the this is auto-probed and the network
interface is matched based on the MAC address.

GZ can do DHCP but you still need to update the MAC address. The code that I wrote is specific for running virtualized under SmartOS, but could be adapted:
https://github.com/nshalman/smartos-in-jpc/blob/master/method/fix-config
Fix line 4 to find the right MAC address (I would start with "dladm show-phys -m | <the rest of your pipeline to clean up the output>" If you happen to know that it will always be e1000g0 then it could probably be:
    ADMIN_MAC=$(dladm show-phys -m | awk '/e1000g0/{print $3}')

Any other thoughts regarding my endeavor? Has anyone done this before?
Further hints/tips?

I believe that Nahum Shalman has done something similar when he prepared
a SmartOS image to be run on JPC.

http://blog.shalman.org/smartos-on-smartos-in-the-jpc/

He used two disks, and only have one, so it’s not exactly the same.

Thanks for any helpful comments.

So again, this is non-standard use of SmartOS, but should be pretty straightforward to do.

Let me know if you still have questions.
-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