Configuring a Solaris Zone
Due Credit:
Configuration:
To configure a Solaris zone, we need to know the following networking parameters:
a. An IP address
b. The name of the network interface
c. You should also confirm that the file system.
Zonecfg command
Used to configure the zone.
This command also used to verify that resource and properties that are specified during configuration.
It checks that a zone path has been specified.
Configuring and defining a new zone:
1. Verify that whether that zone is already exists or not global
# zonecfg testzone
Then it will enter into zonecfg shell prompt like
zonecfg:emailzone
2. Create a new zone definition with the create command
zonecfg:email-zone> create
3. Assign the zone to a file system
zonecfg:email-zone> set zonepath=/export/home/zones/t estzone
4. Decide if the zone should boot automatically at system boot time
zonecfg:my-zone> set autoboot=true
5. To create a filesystem
zonecfg:testzone> add fs
zonecfg:testzone:fs>set dir=/data
zonecfg:testzone:fs>set special=/dev/dsk/c0t1d0s0
zonecfg:testzone:fs>set raw=/dev/rdsk/cot1d0s0
zonecfg:testzone:fs>set type=ufs
zonecfg:testzone:fs>end
6. (Sparse Root Zone Only) Add a shared file system that is loopback-mounted from the global zone.
Do not perform this step to create a whole root zone, which does not have any shared file systems
zonecfg:my-zone> add inherit-pkg-dir
zonecfg:testzone:inherit-pkg- dir>set dir=/opt/sfw
zonecfg:testzone:inherit-pkg- dir>end
7. Configure networking parameters, using the addnet command and its sub commands.
zonecfg:testzone:>add net
zonecfg:testzone:net> set address=192.1.1.1
zonecfg:testzone:net> set physical=hme0
zonecfg:testzone:net>end
8. Assign the zone to the email pool
zonecfg:testzone>set pool=email-pool
9. Verify the configuration is syntactically correct
zonecfg:testzone>verify
This will return a message only if any errors in the configuration were found.
10. Save the configuration and exit
zonecgf:email-zone> commit
zonecfg:email-zone> exit
A standard zone automatically shares the /usr, /lib, /platform, and /sbin file systems with global zone.
Standard zone configuration mounts all global file systems as read-only
So if u trying to install an application to any of these directories will fail. So we have to mount a global zone file system with write permissions.
In the global zone, create the directory to be exported to the zone, using the mkdir(1) command.
global# mkdir -p /export/home/zones/testzone/l ocal
Set the permissions such that only root in the global zone can enter this directory, using the chmod(1) command.
global# chmod 700 /export/home/zones/testzone
To configure a Solaris zone, we need to know the following networking parameters:
a. An IP address
b. The name of the network interface
c. You should also confirm that the file system.
Zonecfg command
Used to configure the zone.
This command also used to verify that resource and properties that are specified during configuration.
It checks that a zone path has been specified.
Configuring and defining a new zone:
1. Verify that whether that zone is already exists or not global
# zonecfg testzone
Then it will enter into zonecfg shell prompt like
2. Create a new zone definition with the create command
zonecfg:email-zone> create
3. Assign the zone to a file system
zonecfg:email-zone> set zonepath=/export/home/zones/t estzone
4. Decide if the zone should boot automatically at system boot time
zonecfg:my-zone> set autoboot=true
5. To create a filesystem
zonecfg:testzone> add fs
zonecfg:testzone:fs>set dir=/data
zonecfg:testzone:fs>set special=/dev/dsk/c0t1d0s0
zonecfg:testzone:fs>set raw=/dev/rdsk/cot1d0s0
zonecfg:testzone:fs>set type=ufs
zonecfg:testzone:fs>end
6. (Sparse Root Zone Only) Add a shared file system that is loopback-mounted from the global zone.
Do not perform this step to create a whole root zone, which does not have any shared file systems
zonecfg:my-zone> add inherit-pkg-dir
zonecfg:testzone:inherit-pkg- dir>set dir=/opt/sfw
zonecfg:testzone:inherit-pkg- dir>end
7. Configure networking parameters, using the addnet command and its sub commands.
zonecfg:testzone:>add net
zonecfg:testzone:net> set physical=hme0
zonecfg:testzone:net>end
8. Assign the zone to the email pool
zonecfg:testzone>set pool=email-pool
9. Verify the configuration is syntactically correct
zonecfg:testzone>verify
This will return a message only if any errors in the configuration were found.
10. Save the configuration and exit
zonecgf:email-zone> commit
zonecfg:email-zone> exit
A standard zone automatically shares the /usr, /lib, /platform, and /sbin file systems with global zone.
Standard zone configuration mounts all global file systems as read-only
So if u trying to install an application to any of these directories will fail. So we have to mount a global zone file system with write permissions.
In the global zone, create the directory to be exported to the zone, using the mkdir(1) command.
global# mkdir -p /export/home/zones/testzone/l ocal
Set the permissions such that only root in the global zone can enter this directory, using the chmod(1) command.
global# chmod 700 /export/home/zones/testzone
Add Comments
|
|





Add Comments





