Zone migration: [source and destination server must in same SRU]
Requirements:
1.zones created in common storage
2.Applications created in common storage
3.halt zone
4.export configuation
5.detach zone
6.export zpools
Destination server:
1.check common shared things
2.import all common pools
3.take exported configuration file and configure zones
4.check configured zone status
5.attach zone
6.boot zone
# dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
net0 Ethernet up 0 unknown vnet0
net1 Ethernet up 0 unknown vnet1
net2 Ethernet down 0 unknown vnet2
root@guest1:~# echo|format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c2d0 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@0
1. c2d2 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@2
2. c2d3 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@3
3. c2d4 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@4
4. c2d5 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@5
5. c2d6 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@6
6. c2d7 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@7
7. c2d8 <Unknown-Unknown-0001-20.00GB>
/virtual-devices@100/channel-devices@200/disk@8
8. c2d9 <Unknown-Unknown-0001-20.00GB>
/virtual-devices@100/channel-devices@200/disk@9
9. c2d10 <Unknown-Unknown-0001-20.00GB>
/virtual-devices@100/channel-devices@200/disk@a
Specify disk (enter its number): Specify disk (enter its number):
root@guest1:~# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
dbpool 39.8G 345K 39.7G 0% 1.00x ONLINE -
rpool 19.8G 13.7G 6.02G 69% 1.00x ONLINE -
zonepool 19.9G 2.90G 17.0G 14% 1.00x ONLINE -
root@guest1:~# zonestat 5
Collecting data for first interval...
Interval: 1, Duration: 0:00:05
SUMMARY Cpus/Online: 4/4 PhysMem: 4096M VirtMem: 8191M
---CPU---- --PhysMem-- --VirtMem-- --PhysNet--
ZONE USED %PART USED %USED USED %USED PBYTE %PUSE
[total] 1.09 27.3% 831M 20.2% 1584M 19.3% 690 0.00%
[system] 0.01 0.28% 576M 14.0% 1380M 16.8% - -
oraclezone 0.97 48.6% 108M 2.65% 90.6M 1.10% 246 0.00%
global 0.10 5.36% 146M 3.56% 113M 1.39% 444 0.00%
Interval: 2, Duration: 0:00:10
SUMMARY Cpus/Online: 4/4 PhysMem: 4096M VirtMem: 8191M
---CPU---- --PhysMem-- --VirtMem-- --PhysNet--
ZONE USED %PART USED %USED USED %USED PBYTE %PUSE
[total] 1.10 27.5% 831M 20.3% 1585M 19.3% 1276 0.00%
[system] 0.00 0.21% 575M 14.0% 1379M 16.8% - -
oraclezone 0.99 49.7% 109M 2.68% 91.9M 1.12% 246 0.00%
global 0.09 4.87% 146M 3.57% 114M 1.39% 1030 0.00%
^Croot@guest1:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
2 oraclezone running /orazone solaris excl
root@guest1:~# ping 10.66.10.108
10.66.10.108 is alive
root@guest1:~# zoneadm -z oraclezone halt
root@guest1:~#
root@guest1:~#
root@guest1:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- oraclezone installed /orazone solaris excl
root@guest1:~#
root@guest1:~#
root@guest1:~# ping 10.66.10.108
no answer from 10.66.10.108
root@guest1:~#
root@guest1:~#
root@guest1:~# zonecfg -z oraclezone export >/root/testzonefile
root@guest1:~#
root@guest1:~#
root@guest1:~# cat /root/testzonefile
create -b
set zonepath=/orazone
set brand=solaris
set autoboot=false
set ip-type=exclusive
set fs-allowed=zfs,ufs
add net
set configure-allowed-address=true
set physical=net2
end
add capped-memory
set physical=2G
end
add rctl
set name=zone.max-swap
add value (priv=privileged,limit=2147483648,action=deny)
end
add rctl
set name=zone.max-locked-memory
add value (priv=privileged,limit=104857600,action=deny)
end
add dataset
set name=dbpool
end
add dedicated-cpu
set ncpus=2
end
root@guest1:~#
root@guest1:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- oraclezone installed /orazone solaris excl
root@guest1:~#
root@guest1:~#
root@guest1:~# zoneadm -z oraclezone detach
root@guest1:~#
root@guest1:~#
root@guest1:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- oraclezone configured /orazone solaris excl
root@guest1:~#
root@guest1:~#
root@guest1:~#
root@guest1:~# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
dbpool 39.8G 345K 39.7G 0% 1.00x ONLINE -
rpool 19.8G 13.7G 6.02G 69% 1.00x ONLINE -
zonepool 19.9G 2.86G 17.0G 14% 1.00x ONLINE -
root@guest1:~#
root@guest1:~#
root@guest1:~# zpool export dbpool
root@guest1:~#
root@guest1:~#
root@guest1:~# zpool export zonepool
root@guest1:~#
root@guest1:~#
root@guest1:~#
root@guest1:~# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
rpool 19.8G 13.7G 6.02G 69% 1.00x ONLINE -
root@guest1:~#
destination server:
root@rama:~# echo|format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c2d0 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@0
1. c2d2 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@2
2. c2d3 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@3
3. c2d4 <SUN-DiskImage-20GB cyl 566 alt 2 hd 96 sec 768>
/virtual-devices@100/channel-devices@200/disk@4
4. c2d5 <Unknown-Unknown-0001-20.00GB>
/virtual-devices@100/channel-devices@200/disk@5
5. c2d6 <Unknown-Unknown-0001-20.00GB>
/virtual-devices@100/channel-devices@200/disk@6
6. c2d7 <Unknown-Unknown-0001-20.00GB>
/virtual-devices@100/channel-devices@200/disk@7
Specify disk (enter its number): Specify disk (enter its number):
root@rama:~# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
rpool 19.8G 15.7G 4.01G 79% 1.00x ONLINE -
root@rama:~#
root@rama:~#
root@rama:~# zpool import
pool: zonepool
id: 10305956564433298362
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
zonepool ONLINE
c2d7 ONLINE
pool: dbpool
id: 18293875666608214673
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
dbpool ONLINE
c2d6 ONLINE
c2d5 ONLINE
root@rama:~# zonecfg -z zonename -f filename
root@rama:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- oraclezone configured /orazone solaris excl
root@rama:~#
root@rama:~#
root@rama:~# zpool import zonepool
root@rama:~# zpool import dbpool
root@rama:~# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
dbpool 39.8G 408K 39.7G 0% 1.00x ONLINE -
rpool 19.8G 15.7G 4.01G 79% 1.00x ONLINE -
zonepool 19.9G 2.86G 17.0G 14% 1.00x ONLINE -
root@rama:~# df -kh
Filesystem Size Used Available Capacity Mounted on
rpool/ROOT/bkpsoalris-1
19G 4.5G 1.4G 76% /
/devices 0K 0K 0K 0% /devices
/dev 0K 0K 0K 0% /dev
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 7.4G 2.6M 7.4G 1% /system/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
fd 0K 0K 0K 0% /dev/fd
rpool/ROOT/bkpsoalris-1/var
19G 2.1G 1.4G 60% /var
swap 7.4G 0K 7.4G 0% /tmp
rpool/export 19G 32K 1.4G 1% /export
rpool/export/home 19G 33K 1.4G 1% /export/home
rpool/export/home/rama
19G 35K 1.4G 1% /export/home/rama
rpool/export/home/sai
19G 693K 1.4G 1% /export/home/sai
rpool 19G 73K 1.4G 1% /rpool
zonepool 20G 35K 17G 1% /orazone
root@rama:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- oraclezone configured /orazone solaris excl
root@rama:~# zoneadm -z oraclezone attach
Progress being logged to /var/log/zones/zoneadm.20130419T111811Z.oraclezone.attach
Attaching...
Installing: Using existing zone boot environment
Zone BE root dataset: zonepool/rpool/ROOT/solaris-backup-1
Cache: Using /var/pkg/publisher.
Updating image format
Updating non-global zone: Linking to image /.
Cache: Using /var/pkg/publisher.
Updating non-global zone: Auditing packages.
No updates necessary for this image.
Updating non-global zone: Zone updated.
Result: Attach Succeeded.
Log saved in non-global zone as /orazone/root/var/log/zones/zoneadm.20130419T111811Z.oraclezone.attach
root@rama:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- oraclezone installed /orazone solaris excl
root@rama:~#
root@rama:~#
root@rama:~#
root@rama:~# zoneadm -z oraclezone boot
root@rama:~#
root@rama:~#
root@rama:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
2 oraclezone running /orazone solaris excl
root@rama:~# more /orazone/root/var/log/zones/zoneadm.20130419T111811Z.oraclezone.attach
[Friday, April 19, 2013 04:48:11 PM IST] ==== Starting: /usr/lib/brand/solaris/attach oraclezone /orazone ====
[Friday, April 19, 2013 04:48:11 PM IST] Progress being logged to /var/log/zones/zoneadm.20130419T111811Z.oraclezone.attach
[Friday, April 19, 2013 04:48:11 PM IST] Pinning datasets under zonepool
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/ROOT
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/ROOT/solaris
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/ROOT/solaris@install
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/ROOT/solaris@2013-04-18-10:32:16
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/ROOT/solaris-backup-1
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/ROOT/solaris-backup-1/var
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/ROOT/solaris/var
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/ROOT/solaris/var@install
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/ROOT/solaris/var@2013-04-18-10:32:16
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/export
[Friday, April 19, 2013 04:48:11 PM IST] Pinning zonepool/rpool/export/home
[Friday, April 19, 2013 04:48:13 PM IST] Promoting active dataset 'zonepool/rpool/ROOT/solaris-backup-1'
[Friday, April 19, 2013 04:48:14 PM IST] Mounting boot environment in zonepool/rpool/ROOT/solaris-backup-1 at /orazone/root (including child datasets)
[Friday, April 19, 2013 04:48:14 PM IST] Preparing to mount zonepool/rpool/ROOT/solaris-backup-1 at /orazone/root
[Friday, April 19, 2013 04:48:14 PM IST] Mounting zonepool/rpool/ROOT/solaris-backup-1 at /orazone/root/ with ZFS temporary mount
[Friday, April 19, 2013 04:48:14 PM IST] Preparing to mount zonepool/rpool/ROOT/solaris-backup-1/var at /orazone/root
[Friday, April 19, 2013 04:48:14 PM IST] Mounting zonepool/rpool/ROOT/solaris-backup-1/var at /orazone/root/var with ZFS temporary mount
[Friday, April 19, 2013 04:48:14 PM IST] Attaching...
[Friday, April 19, 2013 04:48:14 PM IST] existing
[Friday, April 19, 2013 04:48:14 PM IST] Installing: Using existing zone boot environment
[Friday, April 19, 2013 04:48:14 PM IST] Unmounting /orazone/root/var
[Friday, April 19, 2013 04:48:14 PM IST] Mounting boot environment in zonepool/rpool/ROOT/solaris-backup-1 at /orazone/root (including child datasets)
[Friday, April 19, 2013 04:48:15 PM IST] Preparing to mount zonepool/rpool/ROOT/solaris-backup-1 at /orazone/root
[Friday, April 19, 2013 04:48:15 PM IST] Preparing to mount zonepool/rpool/ROOT/solaris-backup-1/var at /orazone/root
[Friday, April 19, 2013 04:48:15 PM IST] Mounting zonepool/rpool/ROOT/solaris-backup-1/var at /orazone/root/var with ZFS temporary mount
[Friday, April 19, 2013 04:48:15 PM IST] Sanity Check: Passed. Looks like a Solaris system.
[Friday, April 19, 2013 04:48:15 PM IST] Zone BE root dataset: zonepool/rpool/ROOT/solaris-backup-1
[Friday, April 19, 2013 04:48:18 PM IST] Cache: Using /var/pkg/publisher.
[Friday, April 19, 2013 04:48:18 PM IST] Updating image format
[Friday, April 19, 2013 04:48:41 PM IST] Updating non-global zone: Linking to image /.
[Friday, April 19, 2013 04:48:41 PM IST] Running 'pkg attach-linked --linked-md-only --no-refresh --allow-relink -f -c zone:oraclezone /orazone/root'
[Friday, April 19, 2013 04:48:48 PM IST] Cache: Using /var/pkg/publisher.
[Friday, April 19, 2013 04:48:51 PM IST] Running 'pkg -R /orazone/root list --no-refresh -Hv'
[Friday, April 19, 2013 04:49:04 PM IST] Updating non-global zone: Auditing packages.
[Friday, April 19, 2013 04:49:04 PM IST] Running 'pkg sync-linked --no-pkg-updates -I --no-refresh --accept'
[Friday, April 19, 2013 04:49:17 PM IST]
Updating non-global zone: Zone updated.
[Friday, April 19, 2013 04:49:17 PM IST] Result: Attach Succeeded.
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning datasets under zonepool
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/ROOT
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/ROOT/solaris
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/ROOT/solaris-backup-1
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/ROOT/solaris-backup-1@install
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/ROOT/solaris-backup-1@2013-04-18-10:32:16
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/ROOT/solaris-backup-1/var
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/ROOT/solaris/var
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/ROOT/solaris/var@install
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/ROOT/solaris/var@2013-04-18-10:32:16
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/export
[Friday, April 19, 2013 04:49:17 PM IST] Unpinning zonepool/rpool/export/home
[Friday, April 19, 2013 04:49:17 PM IST] ==== Completed: /usr/lib/brand/solaris/attach oraclezone /orazone ====
No comments:
Post a Comment