Using ZFS as root filesystems on global zone and local zone is huge advantage for OS patching. ZFS is very flexible with Liveupgrade, so that rollback action is very simple. It’s Just reboot. Here we will see what type of zone+zfs configuration will support in Solaris 10 for Liveupgrade.
If you are planning to use zones in production, better keep dedicated zpool and make sure that you are keeping zone root path under zfs dataset not under zpool “.i.e Not in /lzpool1 .keep it in /lzpool1/rpool”. Otherwise you cannot use live upgrade feature.
For example, in your environment if you have more than 2 to 3 physical server, make sure that you are provisioning LUN’s to all the three physical serves. In case if your one of physical server failed, you can import the zpool to other global and you can start the zone .But make sure you have the copy of zone configuration files copied over to other global zones. You can use below command to export the configuration file.
The below mentioned setup will eliminate solaris bug CR: 6867013
(Zones residing on top level of the pool dataset)
Creating new zpool for localzone
(Zones residing on top level of the pool dataset)
Creating new zpool for localzone
bash-3.00# zpool create lzpool1 c1t4d0
Creating new dataset:
bash-3.00# zfs create lzpool1/rpool
bash-3.00# zfs list |grep lzpool
lzpool1 104K 3.91G 21K /lzpool1
lzpool1/rpool 21K 3.91G 21K /lzpool1/rpool
In zone configuration,set the root directory as below.
zonecfg:zarena> set zonepath=/lzpool1/rpool
Do not set /lzpool1 as local zone root filesystem.Since that mount is sitting on top zpool,it won’t allow to use live upgrade.Its better to create dataset under the zpool and use it as zone’s root filesystem.
Testing Liveupgrade:
bash-3.00#
bash-3.00# lustatus
ERROR: No boot environments are configured on this system
ERROR: cannot determine list of all boot environment names
bash-3.00# lucreate -c oldbe -n newbe
Checking GRUB menu...
Analyzing system configuration.
No name for current boot environment.
Current boot environment is named .
Creating initial configuration for primary boot environment .
The device is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name PBE Boot Device .
Comparing source boot environment file systems with the file
system(s) you specified for the new boot environment. Determining which
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Updating system configuration files.
Creating configuration for boot environment .
Source boot environment is .
Creating boot environment .
Cloning file systems from boot environment to create boot environment .
Creating snapshot for on .
Creating clone for on .
Setting canmount=noauto for </> in zone on .
Creating snapshot for on .
Creating clone for on .
Setting canmount=noauto for in zone on .
Creating snapshot for on .
Creating clone for on .
Saving existing file in top level dataset for BE as //boot/grub/menu.lst.prev.
File propagation successful
Copied GRUB menu from PBE to ABE
No entry for BE in GRUB menu
Population of boot environment successful.
Creation of boot environment successful.
From the above output you can see Liveupgrade is keeping zone’s root snapshot and for BE its creating new dataset. So if patching failed also, you can easily roll back .You will similar error if you are followed the above procedure while creating boot environment.
Creating snapshot for on .
cannot create '.': missing dataset name
Creating clone for on .
ERROR: cannot create 'lzpool1-SOL_2012Q1': missing dataset name
ERROR: Unable to clone <> on <>.
/usr/lib/lu/luclonefs: lzpool1@SOL_2012Q1: not found
cannot open 'lzpool1-SOL_2012Q1': dataset does not exist
cannot open 'lzpool1-SOL_2012Q1': dataset does not exist
cannot open 'lzpool1-SOL_2012Q1': dataset does not exist
cannot open 'lzpool1-SOL_2012Q1': dataset does not exist
cannot open 'lzpool1-SOL_2012Q1': dataset does not exist
ERROR: Failed to mount dataset
cannot open 'lzpool1-SOL_2012Q1': dataset does not exist
Thank you for reading this.Please leave a comment if you have any doubt.I will get back to you.
Leave a Reply