When using Solaris Zones, GDS installation, command execution, and volume creation can be performed only in the global zone. By importing GDS volumes created in the global zone to non-global zones, it becomes possible to use the GDS volumes in the non-global zones.
Note
Understand and pay attention to the following points when using Solaris Zones.
Install GDS in the global zone. GDS cannot be installed in a non-global zone.
GDS commands cannot be executed in non-global zones. If commands of GDS installed in the /usr/sbin directory in the global zone are executed in non-global zones, the following error occurs.
ERROR: cannot be executed in non-global zone |
If a GDS command is used in a non-global zone, the ld.so.1(1) error message may be output depending on the non-global zone creation method.
As a general method for using device in non-global zones, there is a method to place a device (add device) to non-global zones for configuring a zone (zonecfg). For Solaris 11, a volume of GDS on the global zone can be added to the non-global zone with this method. However, for Solaris 10, it cannot be added with this method. For details, see the following description in this chapter.
When the same block within a GDS volume is accessed simultaneously from multiple zones, data consistency is not ensured, as in access to slices that are not managed with GDS. Access exclusion control for maintaining data consistency should be performed by the application that accesses the same block from multiple zones.
If an archive is created by the server where GDS is installed and the non-global zone is created by using the archive, it is not necessary to cancel the GDS settings at the creation of the archive. Cancel the GDS settings after creating the non-global zone.
The settings for system disk mirroring are automatically cancelled by the OS at the creation of the non-global zone. For other GDS settings, follow the procedure below and cancel them.
Execute the following procedure in the non-global zone.
1) Delete the information of the class.
If files other than class.db exist in the/etc/opt/FJSVsdx/sysdb.d directory, delete these files using the rm command.
Also, If the rows other than the comments (rows starting from #) exist in class.db, delete these rows using the vi command.
# cd /etc/opt/FJSVsdx/sysdb.d # ls class.db class0001 # rm class0001 # vi class.db class0001 <- Delete this line # Disk Class List |
2) Delete the device special files.
If files or directories other than _adm, _diag exist in the/etc/opt/FJSVsdx/sysdb.d directory, delete them using the rm command.
# cd /dev/sfdsk # ls _adm _diag class0001 # rm -rf class0001 |
3) If 4.2A00 or previous version of GDS is installed at the non-global zone, remove the FJSVsdx (GDS Basic Software) package.
# pkgrm FJSVsdx |
4) Uninstall GDS.
Refer to the Installation Guide for how to uninstall it.
[Information]
If the step 1 and 2 are not executed correctly, the following messages will be shown and the uninstallation will be failed.
Cannot remove the package, following class(es) exist: |
For using GDS from non-global zone, there are the following five methods:
Creating a root file system of a non-global zone on a volume
Using a volume as a file system from non-global zones (using a special file)
Also, for using GDS Snapshot in Solaris Zones environment, there is the following method:
For details on each method is explained below.
See
When using GDS in a cluster system in Solaris Zones environment, see "PRIMECLUSTER Installation and Administration Guide."
The redundancy of a root file system of a non-global zone can be done by creating a root file system of a non-global zone on a mirror volume. It is possible to avoid the data loss or service stop caused by a disk failure.
Building procedure
[Global zone]
Create a volume to use as a root file system of a non-global zone to a local class or root class.
For creating method of a volume, see "5.1.3 Configuration Settings."
Create a file system on a volume and mount it.
Example: when the class name is class0001, the volume name is volume0001, the file system type is zfs, the ZFS storage pool name is gdspool, and the mountpoint is /gdspool/zone1.
# zpool create gdspool /dev/sfdsk/class0001/dsk/volume0001 # zfs create gdspool/zone1 |
Note
When you start a zone automatically at the time of system booting ("true" is specified in "autoboot" at the time of zone configuration), make settings to mount a file system automatically at the time of system booting.
Change the access privilege of a file system to 700.
Example: when mount point is /gdspool/zone1
# chmod 700 /gdspool/zone1 |
Create the zone configuration.
Specify "mount point" to the zone path set in step 2) and configure the zone.
For creating and changing the zone configuration, see the zonecfg(1M) command manual.
Create a zone.
For creating zone, see the zoneadm(1M) command manual.
It is possible to use a volume created in global zone as raw device from non-global zones by the following procedure.
The building procedure is different for Solaris 11 and Solaris 10.
Building procedure (for Solaris 11)
[Global zone]
Add the volume created in the global zone to the non-global zone by the following procedure:
Create a volume.
For creating method of a volume, see "5.1.3 Configuration Settings."
Add the volume to the non-global zone.
Specify the path of the device special file of the volume created in step 1) to "match," run "add device."
For creation and change of a zone configuration, see the manual of the zonecfg(1M) command.
Example: when the zone name is zone1, the class name is class0001, and the volume name is volume0001
# zonecfg -z zone1 |
Restart the zone.
For restarting the zone, see the manual of the zoneadm(1M) command.
Example: when the zone name is zone1.
# zoneadm -z zone1 reboot |
Confirm that the special file has been added under /dev/sfdsk/class_name/[r]dsk in the non-global zone.
Confirm the following in the non-global zone.
Example: when the class name is class0001 and the volume name is volume0001
# ls -l /dev/sfdsk/class0001/dsk |
Building procedure (for Solaris 10)
[Global zone]
Copy the device special file of the volume created in the global zone to the non-global zone by the following procedure:
Create a volume.
For creating method of a volume, see "5.1.3 Configuration Settings."
Copy the special file of a volume under the /zonepath/dev.
Copy the special file of a volume under the /zonepath/dev using the tar command.
Example: when the zone path is /zone1, the class name is class0001, and the volume name is volume0001
# cd /dev # tar cvf /var/tmp/dsk.tar sfdsk/class0001/dsk/volume0001 a sfdsk/class0001/dsk/volume0001 0K # tar cvf /var/tmp/rdsk.tar sfdsk/class0001/rdsk/volume0001 a sfdsk/class0001/rdsk/volume0001 0K # cd /zone1/dev # tar xvf /var/tmp/dsk.tar tar: block size = 3 x sfdsk/class0001/dsk/volume0001, 0 bytes, 0 tape block # tar xvf /var/tmp/rdsk.tar tar: block size = 3 x sfdsk/class0001/rdsk/volume0001, 0 bytes, 0 tape block |
Confirm that the special files have been copied under /zonepath/dev/sfdsk/class_name/[r]dsk.
Example: when the zone path is /zone1, the class name is class0001, and the volume name is volume0001
# ls -l /zone1/dev/sfdsk/class0001/dsk total 0 brw------- 1 root root 253, 32 Sep 1 00:00 volume0001 # ls -l /zone1/dev/sfdsk/class0001/rdsk total 0 crw------- 1 root root 253, 32 Sep 1 00:00 volume0001 |
Note
The volume's special files copied in the step 2 will be deleted if the non-global zone is detached and then attached. This is due to the OS specification. When this occurred, re-perform the step 2 and 3 after attaching the non-global zone.
Using procedure
[Non-global zone]
Access to raw device using a special file of /dev/sfdsk/class_name/[r]dsk/volume_name
By creating and mounting a file system using the special file added to the non-global zone by "Using a volume as raw device from non-global zones," you can use the volume created in a global zone from non-global zones.
Building procedure
[Global zone]
Perform the building procedure of "Using a volume as raw device from non-global zones."
When the volume to be used as the raw device form the non-global zone is mounted as a file system in the global zone, unmount it.
For Solaris 11, specify types of the file systems to be mounted on the non-global zone.
Example: when the zone name is zone1, the types of the file system to be used in the non-global zone are hsfs, nfs, ufs, and zfs
# zonecfg -z zone1 # zonecfg:zone1> set fs-allowed=hsfs,nfs,ufs,zfs # zonecfg:zone1> exit |
For Solaris 11, restart the zone.
For restarting the zone, see the manual of the zoneadm(1M) command.
Example: when the zone name is /zone1.
# zoneadm -z zone1 reboot |
[Non-global zone]
Create a file system by using the special file of /dev/sfdsk/class_name/dsk/volume_name.
Example: when the class name is class000, the volume name is volume0001, and the file system type is ufs
# newfs /dev/sfdsk/class0001/dsk/volume0001 |
Mount the file system.
Example: when the mount point is /mnt
# mount /dev/sfdsk/class0001/dsk/volume0001 /mnt |
Note
You cannot mount the same file system on multiple non-global zones.
When using the same file system in multiple global zones, you need to perform the method of Using a volume as a file system from a non-global zone (setting the share of a file system by creating and changing the zone configuration).
When stopping a node where a file system is mounted in a non-global zone by using a volume created in shared class, stop a node after unmounting a file system or stopping a non-global zone.
It is possible to use the file system created on a volume in a global zone as a file system from a non-global zone by setting mount of a file system by creating and changing the zone configuration.
Building procedure
[Global zone]
Create a file system.
Do not mount the created file system.
Example: when the class name is class0001, the volume name is volume0001, and the file system type is ufs
# newfs /dev/sfdsk/class0001/dsk/volume0001 |
Note
Specify not to mount a file system automatically at the time of system booting.
Set mount of a file system by creating and changing zone configuration.
Specify a volume where a file system is created to "special" and execute "add fs."
See the zonecfg(1M) command manual for creating and changing zone configuration.
Example: when the zone name is zone1, the directory path (mount point in non-global zone) is /volume0001, the class name is class0001, and the volume name is volume0001
# zonecfg -z zone1
zonecfg:zone1> add fs
zonecfg:zone1:fs> set dir=/volume0001
zonecfg:zone1:fs> set special=/dev/sfdsk/class0001/dsk/volume0001
zonecfg:zone1:fs> set raw=/dev/sfdsk/class0001/rdsk/volume0001
zonecfg:zone1:fs> set type=ufs
zonecfg:zone1:fs> end
zonecfg:zone1> exit |
Reboot a zone.
See the zoneadm(1M) command manual for rebooting zone.
Example: when the zone name is zone1
# zoneadm -z zone1 reboot |
Using procedure
[Non-global zone]
Access to a file system using the directory path (mount point in a non-global zone) specified by creating and changing zone configuration.
Note
Mounting the same file system in multiple non-global zones cannot be performed.
When using the file system in multiple non-global zones, you need to perform the method of "Using a volume as a file system from a non-global zone (setting the share of a file system by creating and changing the zone configuration)."
When stopping node that a file system is mounted in non-global zone by using a volume created in shared class, stop a node after unmounting a file system or stopping non-global zone.
It is possible to use a file system created on a volume in a global zone as a file system from a non-global zone by setting the share of a file system by creating and changing the zone configuration.
Building procedure
[Global zone]
Create a file system and mount it.
Example: when the class name is class0001, the volume name is volume0001, the file system type is ufs, and the mountpoint is /mnt.
# newfs /dev/sfdsk/class0001/dsk/volume0001 # mount -F ufs /dev/sfdsk/class0001/dsk/volume0001 /mnt |
Note
When you start a zone automatically at the time of system booting ("true" is specified in "autoboot" at the time of zone configuration), make settings to mount a file system automatically at the time of system booting.
Make settings to share a file system by creating and changing the zone configuration.
Specify "mount point" set in step 1) to "special" and perform "add fs."
For creating and changing the zone configuration, see the zonecfg(1M) command manual.
Example: when the zone name is zone1, the directory path (mount point in a non-global zone) is /volume0001
# zonecfg -z zone1
zonecfg:zone1> add fs
zonecfg:zone1:fs> set dir=/volume0001
zonecfg:zone1:fs> set special=/mnt
zonecfg:zone1:fs> set type=lofs
zonecfg:zone1:fs> end
zonecfg:zone1> exit |
Reboot a zone.
For rebooting a zone, see the zoneadm(1M) command manual.
Example: when the zone name is zone1
# zoneadm -z zone1 reboot |
Using procedure
[Non-global zone]
Access to a file system using the directory path (mount point in a non-global zone) specified in creating and changing the zone configuration.
Note
When you stop a node which is using the volume created in shared class from a non-global zone, stop a node after stopping a non-global zone.
Volume snapshots in a global zone can be created by using GDS Snapshot in a global zone.
Even for volumes that include a root file system in a non-global zone and volumes that can be used from the non-global zone, snapshots can be created in a global zone.
Also, proxy volumes that created snapshots can be used with the above-mentioned five methods.
For information on how to operate GDS Snapshot in a global zone, it is the same as the one in a physical environment.