Berikut ini adalah tutorial langkah-langkah memindahkan zone/container Solaris ke mesin yang berbeda, disini kita akan memindahkan “zone01″ dari server “source” ke server “destination”
Server source dan server target sama-sama mempunyai sistem operasi Solaris 10/08, dan kebetulan juga tipe mesin yang sama “Sun Sparc M5000″.
List semua zone yang ada di server “source”, terlihat bahwa kita punya “global zone” dan “zone01″, apa perbedaan global zone dan non-global zone? silakan menuju ke link berikut ini.
root@source # zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 zone01 running /zone/zone01 native shared
Matikan zone yang akan kita pindah, dalam hal ini adalah “zone01″
root@source # zoneadm -z zone01 halt
root@source # zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone01 installed /zone/zone01 native shared
Terlihat bahwa status “zone01″ berubah menjadi “installed”
Langkah selanjutnya adalah men-detach “zone01″, setelah itu cek kembali, seharusnya status “zone01″ akan berubah menjadi “configured”.
root@source # zoneadm -z zone01 detach
root@source # zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone01 configured /zone/zone01 native shared
Setelah status “zone01″ berubah menjadi “configured” maka langkah selanjutnya adalah masuk ke folder dimana “zone01″ berada (dalam hal ini ada di /zone), kemudian kompres folder “zone01″ dan salin ke mesin “destination”.
root@source # cd /zone
root@source # tar cvf - zone01 | gzip -c > /backup/zone01.tar.gz
root@source # cd /backup
root@source # scp zone01.tar.gz user@destination:/zone/
Setelah selesai menyalin, saatnya bekerja pada server “destination”.
Masuk ke folder “/zone” kemudian extract berkas hasil salin dari mesin “source” (zone01.tar.gz)
root@destination # cd /zone
root@destination # gunzip < zone01.tar.gz | tar xvf -
Setelah selesai proses extract, maka saatnya kita membuat zone dengan nama “zone01″.
root@destination # zonecfg -z zone01
zone01: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone01> create -a /zone/zone01
zonecfg:zone01> commit
zonecfg:zone01> exit
Coba kita cek kembali zone yang ada di server “destination”, seharusnya muncul zone01 dengan status “configured”
root@destination # zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone01 configured /zone/zone01 native shared
Saatnya attach “zone-01″, pastikan tidak muncul galat.
root@destination # zoneadm -z zone01 attach
These patches installed on the source system are inconsistent with this system:
119788-10: not installed
121081: version mismatch
(08) (06)
Jika muncul galat seperti diatas, lakukan langkah dibawah ini, kemudian coba attach kembali “zone01″ nya.
root@destination # echo 121081 >> /usr/lib/brand/native/bad_patches
root@destination # echo 119788 >> /usr/lib/brand/native/bad_patches
root@destination # zoneadm -z zone01 attach
root@destination # zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone01 installed /zone/zone01 native shared
Yes…! status “zone01″ sudah berubah menjadi “installed”, artinya “zone01″ sudah berhasil dipindah ke mesin “destination”, langkah selanjutnya adalah coba menyalakan zone tersebut di mesin “destination”
root@destination # zoneadm -z zone01 boot
root@destination # zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 zone01 running /zone/zone01 native shared
Alhamdulillah, “zone01″ statusnya sudah berubah menjadi “running” yang artinya zone tersebut sudah hidup di mesin “destination”, selanjutnya silakan coba login ke “zone01″
root@destination # zlogin -C zone01
Untuk keluar dari console login “zone01″ gunakan “tilde” + “titik” (~.)