I had task to migrate Nagios with NagiosGrapher (running on Sparc zone) to another machine (SunFire X4200, yes i386 platform). First I manually migrated "Nagios sparc zone" to test i386 platform and then it was simple doing migration from there to production platform (another X4200 with same Solaris release and additional patches). So in this page I just explain how to migrate non-global zone between 2 totally identical systems. System Serbia has zone France. France zone will be migrated to system Japan and will have new zone name India! 1. Configure whole root zone France to Serbia
{serbia}/zones> mkdir france {serbia}/> zonecfg -z france france: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:france> create zonecfg:france> set zonepath=/zones/france zonecfg:france> add net zonecfg:france:net> set physical=e1000g0 zonecfg:france:net> set address=192.168.20.222 zonecfg:france:net> end zonecfg:france> verify zonecfg:france> commit zonecfg:france> exit |
{serbia}/zones> zonecfg -z france zonecfg:france> remove inherit-pkg-dir dir=/lib zonecfg:france> remove inherit-pkg-dir dir=/platform zonecfg:france> remove inherit-pkg-dir dir=/sbin zonecfg:france> remove inherit-pkg-dir dir=/usr zonecfg:france> verify zonecfg:france> commit zonecfg:france> exit {serbia}/zones> zonecfg -z france info zonename: france zonepath: /zones/france brand: native autoboot: false bootargs: pool: limitpriv: scheduling-class: ip-type: shared net: address: 192.168.20.222 physical: e1000g0 defrouter not specified |
{serbia}/zones> zoneadm -z france install A ZFS file system has been created for this zone. Preparing to install zone <france>. Creating list of files to copy from the global zone. Copying <48022> files to the zone. Initializing zone product registry. Determining zone package initialization order. Preparing to initialize <455> packages on the zone. Initialized <455> packages on zone. Zone <france> is initialized. The file </zones/france/root/var/sadm/system/logs/install_log> contains a log of the zone installation. |
{serbia}/zones/france> zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared - france installed /zones/france native shared |
#The sysidcfg file: #-------------------- system_locale=en_US timezone=US/Pacific timeserver=localhost #name_service=DNS # {domain_name=googlux.com # name_server=xxx.xxx.xxx.xxx} name_service=NONE nfs4_domain=genesyslab.com service_profile=limited_net terminal=vt100 security_policy=NONE root_password=NP network_interface=primary { hostname=france netmask=255.255.255.0 protocol_ipv6=no ip_address=192.168.20.222 default_route=192.168.20.1} |
{serbia}/> zoneadm -z france boot {serbia}/> zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared 1 france running /zones/france native shared |
{serbia}/> zoneadm -z france halt {serbia}/> zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared - france installed /zones/france native shared {serbia}/> zoneadm -z france detach {serbia}/> zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared |
{serbia}/zones> rsync -avH france japan:/zones/ |
network_interface=primary { hostname=india netmask=255.255.255.0 protocol_ipv6=no ip_address=192.168.24.35 default_route=192.168.24.1} |
{japan}/tmp> zonecfg -z india india: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:india> create -a /zones/india zonecfg:india> info ---> see zone info zonename: india zonepath: /zones/india brand: native autoboot: false bootargs: pool: limitpriv: scheduling-class: ip-type: shared net: address: 192.168.20.222 ----> change IP physical: e1000g0 defrouter not specified zonecfg:india> select net physical=e1000g0 zonecfg:india:net> set address=192.168.24.35 zonecfg:india:net> end zonecfg:india> commit zonecfg:india> exit |
{japan}/tmp> zoneadm -z india attach {japan}/tmp> zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared - india installed /zones/india native shared |
{japan}/tmp> zoneadm -z india boot {japan}/tmp> zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared 3 india running /zones/india native shared {japan}/tmp> zlogin -C india [Connected to zone 'india' console] france console login: --------------> hostname has to be changed |