Samedi 30 mars 2013 6 30 /03 /Mars /2013 22:20

 

Everyone knows that one of the major problem for consolidating Solaris 10 is network. if each Solaris Zones use a different network (vlan), the configuration of the Global Zone becomes a real headache.

 

In Solaris 11, Crosbow effectively addresses this problem. This article explains how to create several Solaris Zone an emphasis on network configuration (several vlan).

 

In this example, there are 3 Solaris Zone running on dedicated systems that are exposed to the external networks. Each Solaris Zone runs a different vlan.

  • The Global Zone running in vlan id 1 (Address: 192.168.1.10/24 - Router: 192.168.1.1)
  • The Solaris Zone zone1 running in vlan id 1 (Address: 192.168.1.11/24 - Router: 192.168.1.1)
  • The Solaris Zone zone2 running in vlan id 2 (Address: 192.168.2.10/24 - Router: 192.168.2.1)
  • The Solaris Zone zone3 running in vlan id 3 (Address: 192.168.3.10/24 - Router: 192.168.3.1)
  • Each port of NIC used by aggregation is configured in different vlans (vlan id 1, 2 and 3)

Let's go... Just wait... The network configuration of switch must be already configured (please contact network team !?)

 

 

Step 1: Create link aggregation

 

My system (Sparc M5000) includes 4 NICs. There is no network configuration yet (I connect on XSCF).

 

# dladm show-phys
LINK       MEDIA         STATE      SPEED  DUPLEX    DEVICE
net1       Ethernet      unknown    0      unknown   bge1
net0       Ethernet      unknown    0      unknown   bge0
net3       Ethernet      unknown    0      unknown   bge3
net2       Ethernet      unknown    0      unknown   bge2

 

I create a basic link aggregation (I don't use LACP) with 4 NICs.

 

# dladm create-aggr -P L2,L3 -l net0 -l net1 -l net2 -l net3 default0

 

I check quicly the status of the aggregation.

 

# dladm show-link
LINK          CLASS     MTU    STATE    OVER
net1          phys      1500   up       --
net0          phys      1500   up       --
net3          phys      1500   up       --
net2          phys      1500   up       --
default0      aggr      1500   up       net0 net1 net2 net3

 

Yet, I configure address on this aggregation.

 

# ipadm create-ip default0
# ipadm create-addr -T static -a local=192.168.1.10/24 default0/v4

 

Don't forget, the configuration of router.

 

# route add -p default 192.168.1.1 -ifp default0

 

 

Step 2: Create Solaris Zone for Cloning

 

It is much faster to clone Solaris Zone than to create one from scratch, because building an image from packages takes longer than, in essence, copying an existing zone. I use the cloning technique in this example to first create one Solaris Zone and then clone it three times.

 

# zfs create -o mountpoint=/zones -o dedup=on rpool/zones
# zfs create -o mountpoint=/zones/zclone rpool/zones/zclone
# chmod 700 /zones/zclone

 

# zonecfg -z zclone
Use 'create' to begin configuring a new zone.
zonecfg:zclone> create
create: Using system default template 'SYSdefault'
zonecfg:zclone> set zonepath=/zones/zclone
zonecfg:zclone> set ip-type=exclusive
zonecfg:zclone> exit

 

# zoneadm -z zclone install
Progress being logged to /var/log/zones/zoneadm.20130329T161207Z.zclone.install
       Image: Preparing at /zones/zclone/root. 
[...] 
  Next Steps: Boot the zone, then log into the zone console (zlogin -C)
              to complete the configuration process.
Log saved in non-global zone as /zones/zclone/root/var/log/zones/zoneadm.20130329T161207Z.zclone.install

 

# zoneadm -z zclone boot ; zlogin -C zclone
[Connected to zone 'zclone' console]
Loading smf(5) service descriptions: 115/115

 

When I obtain the screen to configure this Solaris Zone, I halt this zone.

 

# zoneadm -z zclone halt

 

 

Step 3: Create Solaris Zones zone1

 

Remimber, Solaris Zone zone1 use a same vlan that Global Zone. First, I create a vlan link over a datalink (default0).

 

# dladm create-vnic -v 1 -l default0 vnic1

 

Next, I create zone1 from the zclone zone (don't forget a profile creation - new sysidcfg).

 

# zonecfg -z zone1 "create -t zclone"
# zonecfg -z zone1
zonecfg:zone1> set zonepath=/zones/zone1
zonecfg:zone1> select anet linkname=net0
zonecfg:zone1:anet> set linkname=vnic1
zonecfg:zone1:anet> set lower-link=default0
zonecfg:zone1:anet> end
zonecfg:zone1> commit
zonecfg:zone1> exit

 

# zoneadm -z zone1 clone -c /tmp/sc_profile1.xml zclone
The following ZFS file system(s) have been created:
    rpool/zones/zone1
Progress being logged to /var/log/zones/zoneadm.20130329T172124Z.zone1.clone
Log saved in non-global zone as /zones/zone1/root/var/log/zones/zoneadm.20130329T172124Z.zone1.clone

 

 

Step 4: Create Solaris Zones zone2

 

Solaris Zone zone2 use a vlan id 2. First, I create a vlan link over a datalink (default0).

 

# dladm create-vnic -v 2 -l default0 vnic2

 

Next, I create zone2 from the zclone zone (don't forget a profile creation - new sysidcfg). Beware, I use the following paramater to configure the vlan id: vlan-id.

 

# zonecfg -z zone2 "create -t zclone"
# zonecfg -z zone2
zonecfg:zone2> set zonepath=/zones/zone2
zonecfg:zone2> select anet linkname=net0
zonecfg:zone2:anet> set linkname=vnic2
zonecfg:zone2:anet> set lower-link=default0
zonecfg:zone2:anet> set vlan-id=2
zonecfg:zone2:anet> end
zonecfg:zone2> commit
zonecfg:zone2> exit

 

# zoneadm -z zone2 clone -c /tmp/sc_profile2.xml zclone
The following ZFS file system(s) have been created:
    rpool/zones/zone2
Progress being logged to /var/log/zones/zoneadm.20130329T174913Z.zone2.clone
Log saved in non-global zone as /zones/zone2/root/var/log/zones/zoneadm.20130329T174913Z.zone2.clone

 

 

Step 5: Create Solaris Zones zone3

 

It's the same configuration than zone2, the only change comes from vlan id. This zone uses a vlan id 3.

 

# dladm create-vnic -v 3 -l default0 vnic3

 

# zonecfg -z zone3 "create -t zclone"
# zonecfg -z zone3
zonecfg:zone3> set zonepath=/zones/zone3
zonecfg:zone3> select anet linkname=net0
zonecfg:zone3:anet> set linkname=vnic3
zonecfg:zone3:anet> set lower-link=default0
zonecfg:zone3:anet> set vlan-id=3
zonecfg:zone3:anet> end
zonecfg:zone3> commit
zonecfg:zone3> exit

 

# zoneadm -z zone3 clone -c /tmp/sc_profile3.xml zclone
The following ZFS file system(s) have been created:
    rpool/zones/zone3
Progress being logged to /var/log/zones/zoneadm.20130329T175707Z.zone3.clone
Log saved in non-global zone as /zones/zone3/root/var/log/zones/zoneadm.20130329T175707Z.zone3.clone

 

 

Step 6: Start all Solaris Zone

 

My configuration is finished. I just start all zone.

 

# zoneadm list -cv
  ID NAME      STATUS     PATH               BRAND    IP   
   0 global    running    /                  solaris  shared
   - zclone    installed  /zones/zclone      solaris  excl 
   - zone1     installed  /zones/zone1       solaris  excl 
   - zone2     installed  /zones/zone2       solaris  excl 
   - zone3     installed  /zones/zone3       solaris  excl 

 

# zoneadm –z zone1 boot ; zoneadm –z zone2 boot ; zoneadm –z zone3 boot

 

 

Conclusion: We hope this step-by-step guide will give you some ideas for future consolidation. With Oracle Solaris 11 capabilities, you can easily set up fairly complex environments.

 

 

See Also

 

Par gloumps - Publié dans : réseau
Ecrire un commentaire - Voir les 2 commentaires
Retour à l'accueil

Présentation

Informations personnelles

  • Passionné d'informatique, je travaille actuellement comme expert système Solaris. Vous trouverez plus de renseignements à mon sujet sur mon profil Linkedin.

Flux RSS

  • Flux RSS des articles

Recherche

Calendrier

Août 2014
L M M J V S D
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
             
<< < > >>
Créer un blog gratuit sur over-blog.com - Contact - C.G.U. - Signaler un abus - Articles les plus commentés