Non Global Zone creation

Moderator: cah

Post Reply
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Non Global Zone creation

Post by cah »

Create a NGZ (Non Global Zone) using a configuration file:

Code: Select all

create -b
set zonepath=/zonepool/zones/appint05
set autoboot=true
set ip-type=shared
add inherit-pkg-dir
set dir=/lib
end
add inherit-pkg-dir
set dir=/platform
end
add inherit-pkg-dir
set dir=/sbin
end
add inherit-pkg-dir
set dir=/usr
end
add inherit-pkg-dir
set dir=/opt/sfw
end
add net
set address=10.0.32.148
set physical=igb1
set defrouter=10.0.32.1
end
add attr
set name=comment
set type=string
set value="Appint05 Non Global Zone"
end

Code: Select all

# zonecfg -z appint05 -f /zonepool/zone_configs/appint05_zone
Check NGZ (Non Global Zone) status before installation completed:

Code: Select all

# zoneadm list -icv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   - appint05         configured /zonepool/zones/appint05       native   shared
Install OS to new created NGZ:

Code: Select all

# zoneadm -z appint05 install
A ZFS file system has been created for this zone.
Preparing to install zone <appint05>.
Creating list of files to copy from the global zone.
Copying <3093> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1412> packages on the zone.
Initializing package <1055> of <1412>: percent complete: 74%
......     
Initialized <1249> packages on zone.                                 
Zone <appint05> is initialized.
The file </zonepool/zones/appint05/root/var/sadm/system/logs/install_log> contains a log of the zone installation.


Check NGZ (Non Global Zone) status after installation completed:

Code: Select all

# zoneadm list -icv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   - appint05         installed  /zonepool/zones/appint05       native   shared
Copy sysidcfg (sysidcfg_exclusive_IP or sysidcfg_shared_IP) to newly created zone's /etc directory:

Code: Select all

cp /zonepool/zone_configs/appint05_sysidcfg /zonepool/zones/appint05/root/etc/sysidcfg
Boot up the new NGZ:

Code: Select all

# zoneadm -z appint05 boot
Check zone status:

Code: Select all

# zoneadm list -icv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   1 appint05         running    /zonepool/zones/appint05       native   shared
Login appint05:

Code: Select all

zlogin -C appint05
[Connected to zone 'appint05' console]
Loading smf(5) service descriptions:  48/155
...
Loading smf(5) service descriptions: 155/155
Reading ZFS config: done.
 network_interface=igb1 {
 ^                 
igb1 is not a valid network interface  line 3 position 19
Creating new rsa public/private host key pair
Creating new dsa public/private host key pair
Configuring network interface addresses: igb1.

CAH, The Great
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

sysidcfg does not work completely

Post by cah »

When I copied over the following sysidcfg values over to appint05 NGZ's /etc:

Code: Select all

system_locale=en_US
terminal=vt100
name_service=DNS {
        domain_name=ols.minimed.com
        name_server=10.0.16.123,10.0.16.130,10.48.32.54
        search=ols.minimed.com,corp.minimed.com,corp.medtronic.com
}
network_interface=igb1 {
        hostname=appint05
        ip_address=10.0.32.148
        netmask=255.255.254.0
        protocol_ipv6=no
        default_route=10.0.32.1
}
security_policy=NONE
nfs4_domain=dynamic
root_password=2JklIXb7E4dQI
timezone=US/Pacific
The server started but complained about the network interface is not valid:

Code: Select all

%zlogin -C appint05
[Connected to zone 'appint05' console]

Hostname: appint05
Reading ZFS config: done.
 network_interface=igb1 {
 ^                 
igb1 is not a valid network interface  line 8 position 19
Configuring network interface addresses: igb1.
However, it moved on and became interactive server configuration except it took the IP address, netmask and default route.

Code: Select all

 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  Enter the host name which identifies this system on the network.  The name
  must be unique within your domain; creating a duplicate host name will cause
  problems on the network after you install Solaris.

  A host name must have at least one character; it can contain letters,
  digits, and minus signs (-).


                Host name for igb1:1 appint05









  

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
    Esc-2_Continue    Esc-6_Help
The worst case scenarios is to manually configure hostname and name service information.
CAH, The Great
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

sysidcfg configuration

Post by cah »

It looks like the network_interface needs to have PRIMARY as the interface:

network_interface=PRIMARY {
hostname=appint05
ip_address=10.0.32.148
netmask=255.255.254.0
protocol_ipv6=no
default_route=10.0.32.1
}

or

network_interface=PRIMARY {
hostname=appint05
}

Not sure if netmask is needed.
CAH, The Great
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Name Service Error

Post by cah »

While I was trying to set up a template zone (short for non global zone), I randomly picked an IP address for it.
After cloning from existing zone, I copied over the sysidcfg to zone's /etc.
When I booted it up, it complained about Name Service Error and I had to manually choose DNS and then it had all information populated in all fields. The information is in the sysidcfg and that means it read the file.

After checking with Oracle support, he thinks it may be the A record's issue.
For example, template was not in DNS and that's why it failed.

I think it makes sense.
However, more testings are needed to confirm this suggestion.
CAH, The Great
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Missing DNS A record caused sysidcfg Name Service to fail

Post by cah »

After adding a new A record in DNS, the zone takes all settings from sysidcfg without any manual input.

Make sure to add DNS A records before creating zones.
CAH, The Great
Post Reply