Oct 29, 2009

How to Create a Zpool and Zones in Solaris ?

Description: Creating a zpool / Zones

Platform: SUN

Model: Server

Category: Install

Problem statement: Zpools and Zone Creation

RCA Summary: N.A

Solution: N.A

Work around: Find it Below

Creating a zpool

ZFS uses device names or partition names when dealing with pools and devices. For a device, this will be something like c1t0d0 (for a SCSI device) or c1d1 (for an IDE device). For a partition, it will be something like c1t0d0s0 (for a SCSI device)or c1d1s0 (for an IDE device). This example creates a pool that is mirrored using two disks.

1. To create a zpool in the global zone, use the zpool create command. Typically, you use two devices to provide redundancy.

Global# zpool create mypool mirror c2t5d0 c2t6d0

Note that the zpool create command may fail if the devices are in use or contain some types of existing data (e.g. UFS file system). If they are in use, you will need to unmount them or otherwise stop using them. If they contain existing data you can use the -f (force) flag to override the safety check, but be sure that you are not destroying any data you

want to retain.

2. Examine the pool properties using the zpool list command.

Global# zpool list

clip_image002

This shows you that there is one zpool, named mypool, with a capacity of 199GBytes.

Creating a Zone

To show ZFS working in an environment that is isolated from other applications on the system, you need to create a zone.

To create a zone:

1. Create a directory where the zone file system will reside, using the mkdir command. Be sure to chose a location where the file system has at least 80MBytes of available space.

Global# mkdir /zones

Note that in this example, for the sake of brevity, the root file system of the zone is a UFS file system.

2. Configure the zone (myzone), using the zonecfg command, and specify the location of the zone's files (/zones/myzone). Use the following series of commands.

Global# zonecfg -z myzone

myzone: No such zone configured

Use 'create' to begin configuring a new zone

zonecfg:myzone> create

zonecfg:myzone> set zonepath=/zones/myzone

zonecfg:myzone> verify

zonecfg:myzone> commit

zonecfg:myzone> exit

Again, for the purpose of streamlining, this example uses a very minimal zone. For more details on creating zones see the Solaris Containers How To Do Stuff guide at:

www.sun.com/software/solaris/howtoguides/containersLowRes.jsp

3. Install the zone by using the zoneadm.

Global# zoneadm -z myzone install

Preparing to install zone <myzone>

[Output from zoneadm, this may take a few mins]

4. Boot the zone to complete the installation, using the zoneadm command.

Global# zoneadm -z myzone boot

5. Use the zlogin command to connect to the zone console.

Global# zlogin -C myzone

[Connected to zone 'myzone' console]

[Initial zone boot output, service descriptions are loaded etc.]

It may take a short while for the first boot to configure everything, load all the service descriptors, and so on. You will

need to answer the system configuration details. Some suggestions are:

Terminal=(12)X Terminal Emulator (xterms)

Not Networked

No Kerberos

Name service = None

Time Zone = your-time-zone

root passwd = (Your choice – remember it though!)

The zone will reboot after you have provided the configuration information.

6. Before you can proceed to the next stage, the configured zone needs to be shutdown (configuration changes are only applied when the zone boots).

Global# zlogin myzone init 5

References:

0 comments:

Text Widget

Copyright © Vinay's Blog | Powered by Blogger

Design by | Blogger Theme by