{"id":554,"date":"2009-12-14T12:17:18","date_gmt":"2009-12-14T17:17:18","guid":{"rendered":"http:\/\/www.gamescheat.ca\/?p=554"},"modified":"2019-09-04T19:57:40","modified_gmt":"2019-09-05T00:57:40","slug":"step-by-step-instructions-on-how-to-create-a-solaris-10-container","status":"publish","type":"post","link":"http:\/\/www.gamescheat.ca\/?p=554","title":{"rendered":"Step by step instructions on how to create a Solaris 10 container."},"content":{"rendered":"<p>Here is a step by step instructions on how I created a Solaris 10 container.  I took advantage of the Solaris ZFS file system because of it\u2019s inherient benifits such as quotas, compression, snapshots, shared storage of zone pool and zone cloning.<\/p>\n<p>The first thing you need to do is to identify the free disk space.  In my case I had already installed a new LUN on a fiber channel SAN and the LUN appears as a new disk in Solaris 10 (<a href=\"http:\/\/www.gamescheat.ca\/2009\/12\/how-to-enable-fiber-channel-multipathing-on-solaris-10-server\/\">http:\/\/www.gamescheat.ca\/2009\/12\/how-to-enable-fiber-channel-multipathing-on-solaris-10-server\/<\/a>).  The format command will display all physical disks that the Os sees.  In the below example disk 2 is the new LUN on the SAN.<\/p>\n<blockquote><p>root@myserver1 # format<br \/>\nSearching for disks\u2026done                                                      <\/p>\n<p>AVAILABLE DISK SELECTIONS:<br \/>\n       0. c0t0d0 <FUJITSU-MBD2147RC-3701 cyl 14087 alt 2 hd 24 sec 848><br \/>\n          \/pci@0,600000\/pci@0\/pci@0\/scsi@0\/sd@0,0<br \/>\n       1. c0t1d0 <FUJITSU-MBD2147RC-3701 cyl 14087 alt 2 hd 24 sec 848><br \/>\n          \/pci@0,600000\/pci@0\/pci@0\/scsi@0\/sd@1,0<br \/>\n       2. c3t60060E800429C400000029C40000030Ad0 <HITACHI-OPEN-V*14   -SUN-5009-3\n50.01GB><br \/>\n          \/scsi_vhci\/ssd@g60060e800429c400000029c40000030a<br \/>\nSpecify disk (enter its number):  <\/p><\/blockquote>\n<p>In most cases the new disk is already preformatted as indicated in the example below, c3t60060E800429C400000029C40000030Ad0<br \/>\n[disk formatted].<br \/>\nIf the disk was not formatted you will not see [disk formatted]. Make a note of the disk name c3t60060E800429C400000029C40000030Ad0, you will need this for later steps.<\/p>\n<blockquote><p>\nSpecify disk (enter its number): 2<br \/>\nselecting c3t60060E800429C400000029C40000030Ad0<br \/>\n[disk formatted]                                                                <\/p>\n<p>FORMAT MENU:<br \/>\n        disk       \u2013 select a disk<br \/>\n        type       \u2013 select (define) a disk type<br \/>\n        partition  \u2013 select (define) a partition table<br \/>\n        current    \u2013 describe the current disk<br \/>\n        format     \u2013 format and analyze the disk<br \/>\n        repair     \u2013 repair a defective sector<br \/>\n        label      \u2013 write label to the disk<br \/>\n        analyze    \u2013 surface analysis<br \/>\n        defect     \u2013 defect list management<br \/>\n        backup     \u2013 search for backup labels<br \/>\n        verify     \u2013 read and display labels<br \/>\n        inquiry    \u2013 show vendor, product and revision<br \/>\n        volname    \u2013 set 8-character volume name<br \/>\n        !<cmd>     \u2013 execute <cmd>, then return<br \/>\n        quit <\/p><\/blockquote>\n<p>Create a new ZFS pool zone with zpool command.                                                       <\/p>\n<blockquote><div style=\"float: left;\"><div style=\"margin: 15px 15px 15px 15px\";><script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"pub-3319935785736004\";\ngoogle_alternate_color = \"FFFFFF\";\ngoogle_ad_width = 234;\ngoogle_ad_height = 60;\ngoogle_ad_format = \"234x60_as\";\ngoogle_ad_type = \"text_image\";\ngoogle_ad_channel =\"\";\ngoogle_color_border = \"cccccc\";\ngoogle_color_link = \"cc0000\";\ngoogle_color_bg = \"ffffff\";\ngoogle_color_text = \"000000\";\ngoogle_color_url = \"008000\";\n\/\/--><\/script>\n<script type=\"text\/javascript\"\n  src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><\/div><\/div><p>root@myserver1 # zpool create -f bigzone c3t60060E800429C400000029C40000030Ad0 <\/p><\/blockquote>\n<p>List the new ZFS pool zone you just created.<\/p>\n<blockquote><p>root@myserver1 # zpool list<br \/>\nNAME     SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT<br \/>\nbigzone   348G  95.5K   348G     0%  ONLINE  \u2013    <\/p><\/blockquote>\n<p>Create the new zone with the zfs create command. The new zone is called myzfs.<\/p>\n<blockquote><p>root@myserver1 # zfs create bigzone\/myzfs<\/p><\/blockquote>\n<p>Verify that the zfs zone was created. By default the new pool will utilize all avaiable disk space.<\/p>\n<blockquote><p>root@myserver1 # zfs list<br \/>\nNAME             USED  AVAIL  REFER  MOUNTPOINT<br \/>\nbigzone            134K   343G    18K  \/bigzone<br \/>\nbigzone\/myzfs    18K   343G    18K  \/bigzone\/myzfs<\/p><\/blockquote>\n<p>You can limit the amount of disk space the new zones uses as in the example below.<\/p>\n<blockquote><p>root@myserver1 # zfs set quota=300g bigzone\/myzfs<\/p><\/blockquote>\n<p>Confirm that the quota took effect.<\/p>\n<blockquote><p>root@myserver1 # zfs list<br \/>\nNAME             USED  AVAIL  REFER  MOUNTPOINT<br \/>\nbigzone          134K  343G    19K  \/bigzone<br \/>\nbigzone\/myzfs 18K   300G    18K  \/bigzone\/myzfs<\/p><\/blockquote>\n<p>The ZFS zones are automatically mounted in Solaris 10. The mount command will display<\/p>\n<blockquote><p>root@myserver1 # mount | grep bigzone<br \/>\n\/bigzone on bigzone read\/write\/setuid\/devices\/nonbmand\/exec\/xattr\/atime\/dev=4010002<br \/>\non Tue Dec  8 14:44:17 2009<br \/>\n\/bigzone\/myzfs on bigzone\/myzfs read\/write\/setuid\/devices\/nonbmand\/exec\/xattr\/<br \/>\natime\/dev=4010003 on Tue Dec  8 14:44:45 2009<\/p><\/blockquote>\n<p>The mount point property for ZFS filesystem must be configured to legacy in order to create a new zone (container).<\/p>\n<blockquote><p>root@myserver1 # zfs set mountpoint=legacy bigzone\/myzfs<\/p><\/blockquote>\n<p>Verify that the mountpoint is set to legacy.<\/p>\n<blockquote><p>root@myserver1 # zfs list<br \/>\nNAME             USED  AVAIL  REFER  MOUNTPOINT<br \/>\nbigzone          144K  343G    19K  \/bigzone<br \/>\nbigzone\/myzfs    18K   300G    18K  legacy                        <\/p><\/blockquote>\n<blockquote><p>Create a new zone (container) with the zonecfg command.<br \/>\nroot@myserver1 # zonecfg -z myzfs<br \/>\nmyzfs: No such zone configured<br \/>\nUse \u2018create\u2019 to begin configuring a new zone.<br \/>\nzonecfg:myzfs> create                                     <\/p>\n<p>Set the zone path, \/bigzone\/myzfs in this example.<br \/>\nzonecfg:myzfs> set zonepath=\/bigzone\/myzfs                     <\/p>\n<p>If you want the virtual server to boot automatically, set autoboot to true.<br \/>\nzonecfg:myzfs> set autoboot=true<\/p>\n<p>This is an optional step.  Creat a file system.<br \/>\nzonecfg:myzfs> add fs<\/p>\n<p>Set the mount point for the zone, \/bigzone\/myzfs<br \/>\nzonecfg:myzfs:fs> set dir=\/bigzone\/myzfs<\/p>\n<p>Specify that \/bigzone\/myzfs in the global zone is to be mounted as bigzone\/myzfs.<br \/>\nzonecfg:myzfs:fs> set special=bigzone\/myzfs<\/p>\n<p>Specify the file system type as zfs.<br \/>\nzonecfg:myzfs:fs> set type=zfs<\/p>\n<p>End the file system specification.<br \/>\nzonecfg:myzfs:fs> end<\/p>\n<p>Optionally you can specify a network card for this new zone.  For example network card bge0 can be dedicated for the global zone and bge1 can be dedicated to the new zone myzfs. The NIc bge1 must be plumbed <\/p>\n<p>in the global zone first with the command \u2018ifconfig bge1 plumb up\u2019.<br \/>\nzonecfg:myzfs> add net<br \/>\nzonecfg:myzfs:net> set physical=bge1<br \/>\nzonecfg:myzfs:net> set address=172.20.9.19\/16<br \/>\nzonecfg:myzfs:net> end                                 <\/p>\n<p>Optionally you can specify the attributes for the new zone.<br \/>\nzonecfg:myzfs> add attr<br \/>\nzonecfg:myzfs:attr> set name=New Virtual Server<br \/>\nzonecfg:myzfs:attr> set type=string<br \/>\nzonecfg:myzfs:attr> set value=\u201dmyzfs\u201d<br \/>\nzonecfg:myzfs:attr> end<\/p>\n<p>Verify the zone configuration.<br \/>\nzonecfg:myzfs> verify<\/p>\n<p>Commit the zone configuration with the commit command. Note, if you do not explicitly type commit at the prompt, a commit is automatically attempted when you exit or an EOF occurs.<br \/>\nzonecfg:myzfs> commit                                  <\/p>\n<p>To view the zone configuration type info at the zonecfg prompt.<br \/>\nzonecfg:myzfs> info<br \/>\nzonename: myzfs<br \/>\nzonepath: \/bigzone\/myzfs<br \/>\nbrand: native<br \/>\nautoboot: true<br \/>\nbootargs:<br \/>\npool:<br \/>\nlimitpriv:<br \/>\nscheduling-class:<br \/>\nip-type: shared<br \/>\ninherit-pkg-dir:<br \/>\n        dir: \/lib<br \/>\ninherit-pkg-dir:<br \/>\n        dir: \/platform<br \/>\ninherit-pkg-dir:<br \/>\n        dir: \/sbin<br \/>\ninherit-pkg-dir:<br \/>\n        dir: \/usr<br \/>\nfs:<br \/>\n        dir: \/bigzone\/myzfs<br \/>\n        special: bigzone\/myzfs<br \/>\n        raw not specified<br \/>\n        type: zfs<br \/>\n        options: []<br \/>\nnet:<br \/>\n        address: 172.20.9.19\/16<br \/>\n        physical: bge1<br \/>\n        defrouter not specified<br \/>\nattr:<br \/>\n        name: New Virtual Server<br \/>\n        type: string<br \/>\n        value: myzfs                         <\/p>\n<p>Type exit<br \/>\nzonecfg:myzfs>exit<\/p><\/blockquote>\n<p>After you have configured the non-global zone verify that it is in configured status.  This means that the zone can now be installed with the zoneadm command.  Zoneadm is the primary tool used to install and administer non-global zones and can only be run form the global zone.<\/p>\n<blockquote><p>root@myserver1 # zoneadm list -cv<br \/>\n  ID NAME             STATUS      PATH                BRAND    IP<br \/>\n   0 global           running     \/                   native   shared<br \/>\n   \u2013 myzfs            configured  \/bigzone\/myzfs      native   shared <\/p><\/blockquote>\n<p>Install the configured zone myzfs using the zoneadm command with the -z install option.  This will take a few minutes to complete.<\/p>\n<blockquote><p>root@myserver1 # zoneadm -z myzfs install<br \/>\nPreparing to install zone <myzfs>.<br \/>\nCreating list of files to copy from the global zone.<br \/>\nCopying <11495> files to the zone.<br \/>\nInitializing zone product registry.<br \/>\nDetermining zone package initialization order.<br \/>\nPreparing to initialize <1923> packages on the zone.<br \/>\nInitialized <1923> packages on zone.<br \/>\nZone <myzfs> is initialized.<br \/>\nThe file <\/bigzone\/myzfs\/root\/var\/sadm\/system\/logs\/install_log> contains a log of the zone installation.<\/p><\/blockquote>\n<p>Check the status of the new non-global zone myzfs, it should have changed to installed.<\/p>\n<blockquote><p>root@myserver1 # zoneadm list -cv<br \/>\n  ID NAME        STATUS     PATH               BRAND    IP<br \/>\n   0 global      running    \/                  native   shared<br \/>\n   \u2013 myzfs       installed  \/bigzone\/myzfs     native   shared <\/p><\/blockquote>\n<p>Now you are ready to boot the non-global zone up.<\/p>\n<blockquote><p>root@myserver1 # zoneadm -z myzfs boot<\/p><\/blockquote>\n<p>The status of the non-global zone will change to running after it has booted up successfully.<\/p>\n<blockquote><p>root@myserver1 # zoneadm list -cv<br \/>\n  ID NAME      STATUS  PATH              BRAND    IP<br \/>\n   0 global      running   \/                    native   shared<br \/>\n   1 myzfs     running    \/bigzone\/myzfs native   shared <\/p><\/blockquote>\n<p>Logon to the console of myzfs using the zlogin command with the -C option.  If you do not specify the -C otpion then you will not not see the Solaris 10 Os installation messages.  The first time you logon to the console, the sysidtool program is automatically started and you will be prompted to configure the time zone and various other tasks.<\/p>\n<blockquote><p>root@myserver1 # zlogin -C myzfs<br \/>\n[Connected to zone \u2018myzfs\u2019 console]    <\/p>\n<p>(you may have to hit the enter key a few times to see the below screen)<\/p>\n<p>Select a Language                                                         <\/p>\n<p>   0. English<br \/>\n   1. French<br \/>\n   2. German<br \/>\n   3. Italian<br \/>\n   4. Japanese<br \/>\n   5. Korean<br \/>\n   6. Simplified Chinese<br \/>\n   7. Spanish<br \/>\n   8. Swedish<br \/>\n   9. Traditional Chinese                                                 <\/p>\n<p>Please make a choice (0 \u2013 9), or press h or ? for help: 0    <\/p><\/blockquote>\n<blockquote><p>Select a Locale                                                           <\/p>\n<p>   0. English (C \u2013 7-bit ASCII)<br \/>\n   1. Albania (ISO8859-2)<br \/>\n   2. Albania (UTF-8)<br \/>\n   3. Australia (ISO8859-1)<br \/>\n   4. Belgium-Flemish (ISO8859-1)<br \/>\n   5. Belgium-Flemish (ISO8859-15 \u2013 Euro)<br \/>\n   6. Belgium-Flemish (UTF-8)<br \/>\n   7. Bokmal, Norway (UTF-8)<br \/>\n   8. Bosnia (ISO8859-2)<br \/>\n   9. Bosnia and Herzegovina (UTF-8)<br \/>\n  10. Brazil (ISO8859-1)<br \/>\n  11. Brazil (UTF-8)<br \/>\n  12. Bulgaria (ISO8859-5)<br \/>\n  13. Bulgaria (UTF-8)<br \/>\n  14. Canada (English) (UTF-8)<br \/>\n  15. Canada-English (ISO8859-1)<br \/>\n  16. Catalan, Spain (ISO8859-1)<br \/>\n  17. Catalan, Spain (ISO8859-15 \u2013 Euro)<br \/>\n  18. Croatia (ISO8859-2)                                                 <\/p>\n<p>Press Return to show more choices.<br \/>\nPlease make a choice (0 \u2013 93), or press h or ? for help:   0        <\/p><\/blockquote>\n<blockquote><p>What type of terminal are you using?<br \/>\n 1) ANSI Standard CRT<br \/>\n 2) DEC VT52<br \/>\n 3) DEC VT100<br \/>\n 4) Heathkit 19<br \/>\n 5) Lear Siegler ADM31<br \/>\n 6) PC Console<br \/>\n 7) Sun Command Tool<br \/>\n 8 ) Sun Workstation<br \/>\n 9) Televideo 910<br \/>\n 10) Televideo 925<br \/>\n 11) Wyse Model 50<br \/>\n 12) X Terminal Emulator (xterms)<br \/>\n 13) CDE Terminal Emulator (dtterm)<br \/>\n 14) Other<br \/>\nType the number of your choice and press Return: 6<\/p><\/blockquote>\n<blockquote><p>Host Name                                                                     <\/p>\n<p> Enter the host name which identifies this system on the network.  The name<br \/>\n must be unique within your domain; creating a duplicate host name will cause<br \/>\n problems on the network after you install Solaris.                            <\/p>\n<p> A host name must have at least one character; it can contain letters,<br \/>\n digits, and minus signs (-).                                                  <\/p>\n<p> Host name    myserver                                                 <\/p>\n<p> F2_Continue    F6_Help    <\/p><\/blockquote>\n<blockquote><p>On this screen you must specify your default time zone.  You can specify a<br \/>\ntime zone in three ways:  select one of the continents or oceans from the<br \/>\nlist, select other \u2013 offset from GMT, or other \u2013 specify time zone file.      <\/p>\n<p>> To make a selection, use the arrow keys to highlight the option and<br \/>\n  press Return to mark it [X].                                                <\/p>\n<p>    Continents and Oceans<br \/>\n    \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014-<br \/>\n\u2013   [ ] Africa<br \/>\n|   [X] Americas<br \/>\n|   [ ] Antarctica<br \/>\n|   [ ] Arctic Ocean<br \/>\n|   [ ] Asia<br \/>\n|   [ ] Atlantic Ocean<br \/>\n|   [ ] Australia<br \/>\n|   [ ] Europe<br \/>\n|   [ ] Indian Ocean<br \/>\nv   [ ] Pacific Ocean                                                         <\/p>\n<p>  F2_Continue    F6_Help                 <\/p><\/blockquote>\n<p>Continue to follow menu prompts to complete the Solaris 10 Os configuration.<\/p>\n<blockquote><p>System identification is completed.                                             <\/p>\n<p>rebooting system due to change(s) in \/etc\/default\/init                          <\/p>\n<p>[NOTICE: Zone rebooting]                                                        <\/p>\n<p>SunOS Release 5.10 Version Generic_141414-07 64-bit<br \/>\nCopyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.<br \/>\nUse is subject to license terms.<br \/>\nHostname: myserver<br \/>\nReading ZFS config: done.     <\/p><\/blockquote>\n<p>If you see the below message, it means that the DNS entry for myserver does not exists. Simply add the A name record for myserver to the DNS server.<\/p>\n<blockquote><p>myserver console login: Dec  8 15:18:24 myserver sendmail[5543]: My unqualified<br \/>\nhost name (localhost) unknown; sleeping for retry     <\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Here is a step by step instructions on how I created a Solaris 10 container. I took advantage of the Solaris ZFS file system because of it\u2019s inherient benifits such as quotas, compression, snapshots, shared storage of zone pool and&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/www.gamescheat.ca\/?p=554\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[19],"tags":[64],"_links":{"self":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/554"}],"collection":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=554"}],"version-history":[{"count":8,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/554\/revisions"}],"predecessor-version":[{"id":983,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/554\/revisions\/983"}],"wp:attachment":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=554"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}