I ran into a situation where I needed to duplicate a Solaris 11 server from the primary data center to a DR site 850 miles away. A couple firewalls and a WAN separate the source from the target. I’m sure there are other ways to accomplish a feat like this but I will describe here the way I decided to do it and a little bit about why.
I think it would help you understand what follows if you first saw the architecture.
(click to enlarge)
I apologize if the graphic is a bit small but you can click on it to enlarge. As you can see, there is no direct path between the source machine and the destination machine. For all practical purposes, there’s not an indirect path either. Fortunately, I am able to log into the machine “domserver” from “master.” I considered using ssh port forwarding but the Solaris installer doesn’t allow ssh logins (even after you edit the configuration and enable the service). Besides, the way I ended up copying the pool gave me a more detailed progress indicator.
Setting up
I already had the Solaris 11.3 text installer .iso file attached to the target LDom. I booted into the installer and got it ready to accept the transfer.
root@domserver:~# ldm start desthost && telnet localhost 5003
LDom desthost started
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connecting to console "desthost" in group "desthost" ....
Press ~? for control options ..
NOTICE: Entering OpenBoot.
NOTICE: Fetching Guest MD from HV.
NOTICE: Starting additional cpus.
NOTICE: Initializing LDC services.
NOTICE: Probing PCI devices.
NOTICE: Finished PCI probing.
SPARC T7-1, No Keyboard
Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.40.5, 8.0000 GB memory installed, Serial #87654321.
Ethernet address 0:14:4f:00:00:00, Host ID: 87654321.
ERROR: /virtual-devices@100/channel-devices@200/disk@0: Can't open disk label package
Boot device: dvd File and args:
|
WARNING: Can not verify signature on unsupported binary format
WARNING: Signature verification of boot-archive bootblk failed
|
SunOS Release 5.11 Version 11.3 64-bit
Copyright (c) 1983, 2015, Oracle and/or its affiliates. All rights reserved.
Remounting root read/write
Probing for device nodes ...
Preparing image for use
Done mounting image
USB keyboard
1. Arabic 15. Korean
2. Belgian 16. Latin-American
3. Brazilian 17. Norwegian
4. Canadian-Bilingual 18. Portuguese
5. Canadian-French 19. Russian
6. Danish 20. Spanish
7. Dutch 21. Swedish
8. Dvorak 22. Swiss-French
9. Finnish 23. Swiss-German
10. French 24. Traditional-Chinese
11. German 25. TurkishQ
12. Italian 26. UK-English
13. Japanese-type6 27. US-English
14. Japanese
To select the keyboard layout, enter a number [default 27]:
1. Chinese - Simplified
2. Chinese - Traditional
3. English
4. French
5. German
6. Italian
7. Japanese
8. Korean
9. Portuguese - Brazil
10. Spanish
To select the language you wish to use, enter a number [default is 3]:
User selected: English
Configuring devices.
Hostname: solaris
Welcome to the Oracle Solaris installation menu
1 Install Oracle Solaris
2 Install Additional Drivers
3 Shell
4 Terminal type (currently xterm)
5 Reboot
Please enter a number [1]: 3
To return to the main menu, exit the shell
root@solaris:/root# zpool create -f -B rpool c1d0
root@solaris:/root# zfs create -pV 4g rpool/dump
root@solaris:/root# zfs create -pV 8g -o primarycache=metadata rpool/swap
root@solaris:/root# ipadm
NAME CLASS/TYPE STATE UNDER ADDR
lo0 loopback ok -- --
lo0/v4 static ok -- 127.0.0.1/8
lo0/v6 static ok -- ::1/128
net0 ip ok -- --
net0/v4 dhcp ok -- ?
net0/v6 addrconf ok -- fe80::214:4fff:fef9:2ca8/10
net1 ip ok -- --
net1/v4 dhcp ok -- ?
net1/v6 addrconf ok -- fe80::214:4fff:fef8:8f1a/10
net2 ip ok -- --
net2/v4 dhcp ok -- ?
net2/v6 addrconf ok -- fe80::214:4fff:fef9:47ac/10
root@solaris:/root# ipadm delete-addr net2/v6
root@solaris:/root# ipadm delete-addr net2/v4
root@solaris:/root# ipadm create-addr -T static -a 192.168.1.74/24 net2/v4
root@solaris:/root#
root@solaris:/root# dfshares domserver
RESOURCE SERVER ACCESS TRANSPORT
domserver:/export/share domserver - -
root@solaris:/root# mkdir /tmp/dom
root@solaris:/root# mount domserver:/export/share /tmp/domNow that we have the pool created, an IP address assigned, and an NFS share mounted from the domain server so we can get to utilities, we’re about ready to start the transfer. I’m using the fabulous mbuffer utility by Thomas Maier-Komor for a couple reasons. First, it is an easy way to solve the “last inch” problem of how to get the pool stream from the primary domain to the guest domain even though the guest won’t accept an ssh connection. Second, it shows me a running total of how much data has been transferred at any given moment as well as an instantaneous view of the transfer speed. Enough babbling, let’s get the target ready to receive.
root@solaris:/root# /tmp/dom/mbuffer -s 128k -m 1g -I 9090 | zfs receive -vFud rpool
The transfer
With our target waiting, let’s tell srchost to start sending to domserver via master. For this particular situation, this is the only reasonable way I could think of to get the data to where we want it.
[root@master ~]# ssh -e none srchost "zfs send -R rpool@ws-phase1" | ssh -Ce none domserver "/export/share/mbuffer -s 128k -m 1g -O 192.168.1.74:9090"
WARNING: could not send rpool/swap@ws-phase1: does not exist
WARNING: could not send rpool/dump@ws-phase1: does not exist
in @ 3060 KiB/s, out @ 3060 KiB/s, 7040 KiB total, buffer 0% full
< . . . >Over on the domserver, we can watch the progress.
receiving full stream of rpool@ws-phase1 into rpool@ws-phase1
received 91.5KB stream in 1 seconds (91.5KB/sec)
receiving full stream of rpool/webroot into rpool/webroot
in @ 2620 KiB/s, out @ 2620 KiB/s, 5504 KiB total, buffer 0% full
in @ 13.0 MiB/s, out @ 13.0 MiB/s, 11.9 MiB total, buffer 0% full
in @ 14.0 MiB/s, out @ 14.0 MiB/s, 18.9 MiB total, buffer 0% full
in @ 10.2 MiB/s, out @ 10.2 MiB/s, 24.0 MiB total, buffer 0% full
in @ 23.0 MiB/s, out @ 23.0 MiB/s, 35.5 MiB total, buffer 0% full
< . . . >
in @ 26.7 MiB/s, out @ 28.2 MiB/s, 111 GiB total, buffer 0% full
in @ 26.5 MiB/s, out @ 26.5 MiB/s, 111 GiB total, buffer 0% full
in @ 26.2 MiB/s, out @ 26.2 MiB/s, 111 GiB total, buffer 0% full
summary: 111 GiByte in 2h 55min 56.8sec - average of 10.7 MiB/s
received 9.64MB stream in 1 seconds (9.64MB/sec)Now that our root pool has been replicated, we need to do a little bit of housecleaning and then see if we were successful.
root@solaris:/root# zpool set bootfs=rpool/ROOT/2018Q4 rpool
root@solaris:/root# bootadm install-bootloader -P rpool
root@solaris:/root# init 6
root@solaris:/root# svc.startd: The system is coming down. Please wait.
svc.startd: 137 system services are now being stopped.
syncing file systems... done
rebooting...
Resetting...
NOTICE: Entering OpenBoot.
NOTICE: Fetching Guest MD from HV.
NOTICE: Starting additional cpus.
NOTICE: Initializing LDC services.
NOTICE: Probing PCI devices.
NOTICE: Finished PCI probing.
SPARC T7-1, No Keyboard
Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.40.5, 8.0000 GB memory installed, Serial #87654321.
Ethernet address 0:14:4f:00:00:00, Host ID: 87654321.
Boot device: disk File and args:
/
SunOS Release 5.11 Version 11.3 64-bit
Copyright (c) 1983, 2018, Oracle and/or its affiliates. All rights reserved.
An inconsistency in the boot archive was detected and the boot archive has been successfully updated. Rebooting
syncing file systems... done
rebooting...
Resetting...
NOTICE: Entering OpenBoot.
NOTICE: Fetching Guest MD from HV.
NOTICE: Starting additional cpus.
NOTICE: Initializing LDC services.
NOTICE: Probing PCI devices.
NOTICE: Finished PCI probing.
SPARC T7-1, No Keyboard
Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.40.5, 8.0000 GB memory installed, Serial #87654321.
Ethernet address 0:14:4f:00:00:00, Host ID: 87654321.
Boot device: /virtual-devices@100/channel-devices@200/disk@0 File and args:
-
SunOS Release 5.11 Version 11.3 64-bit
Copyright (c) 1983, 2018, Oracle and/or its affiliates. All rights reserved.
Hostname: srchost
srchost console login:
telnet> close
Connection to localhost closed.
root@domserver:~# Success!
There you have it, kids. An exact (for all practical purposes) copy of the production server, replicated through two firewalls to the disaster recovery site. If you wanted to get fancy about keeping the copy up to date with the primary, you could set up a cron job to periodically take snapshots of the primary and do a zfs incremental send. Remember, the operating system is now up and running on the target so you can skip the mbuffer step and chain the ssh connections all the way to the target machine.
I hope this write-up helps someone who needs to accomplish a similar work of magic. Leave a comment with any questions and I’ll try to answer them. Suggestions for other ways to accomplish the task are welcome also.