Skip to main content
Syndicate content
I'm mrGilL, I'm Newbie Admin
ถูกปรับปรุง 39 min 18 sec ก่อน

ตัวอย่างการสร้าง Zone บน Solaris 10

พุธ, 09/01/2010 - 09:22

ได้รับมอบหมายงานด่วนมาอีกเช่นเคย โจทย์คือมีเครื่อง Sun มาให้ 1 เครื่อง(Host) แล้วทำ Virtualization บนเครื่อง Sun อีก 3 เครื่อง(Guest) พี่เค้า Guide มาให้ว่าไปศึกษาเรื่อง Zone มา ก็ไปเจอข้อมูลจากเว็บไซต์ต่างประเทศเว็บนึง เลยขอนำมาแปะไว้เป็นวิทยาทานสำหรับผู้ที่กำลังศึกษาเรื่อง Solaris Containers (Zone) ครับ
สรุปโดยคร่าวๆ ตามที่ผมเข้าใจได้ว่า Zone เป็น Virtualization รูปแบบนึงซึ่งเป็นของ Sun ผู้ดูแลระบบไม่จำเป็นต้องติดตั้ง Software ใดๆ เพิ่มเติม สำหรับตัวอย่างขั้นตอนการ Config ดูได้จากด่านล่าง

------ Creating a Zone in Solaris 10 ------ ------------------------------------------- To view a list and status of currently installed zones: ------------------------------------------------------ # zoneadm list -vi ID NAME STATUS PATH 0 global running / 1 jumpstart running /u01/zones/jumpstart To create a new zone: -------------------- # zonecfg -z <zonename> (if the zone has not been configured at all previously, you will receive: <zonename> No such zone configured Use 'create' to begin configuring a new zone. ) a full example of zone creation for a zone called 'zone1': --------------------------------------------------------- # zonecfg -z zone1 zone1: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:zone1> create zonecfg:zone1> set zonepath=/u01/zones/zone1 zonecfg:zone1> set autoboot=true zonecfg:zone1> add fs zonecfg:zone1:fs> set dir=/opt zonecfg:zone1:fs> set special=/opt zonecfg:zone1:fs> set type=lofs zonecfg:zone1:fs> add options [ro,nodevices] zonecfg:zone1:fs> end zonecfg:zone1> verify zonecfg:zone1> add net zonecfg:zone1:net> set address=10.67.1.151/24 zonecfg:zone1:net> set physical=eri0 zonecfg:zone1:net> end zonecfg:zone1> verify zonecfg:zone1> commit zonecfg:zone1> exit # # zoneadm -z zone1 install Preparing to install zone <zone1>. Creating list of files to copy from the global zone. Copying <1887> files to the zone. Initializing zone product registry. Determining zone package initialization order. Preparing to initialize <951> packages on the zone. Initialized <951> packages on zone. Zone is initialized. Installation of <1> packages was skipped. Installation of these packages generated warnings: The file contains a log of the zone installation. # zoneadm -z zone1 boot # zlogin -e \@ -C zone1 # -e sets the escape sequence for console session [Connected to zone 'zone1' console] To Delete a Zone Permanently: ---------------------------- zoneadm -z <zonename> halt zoneadm -z <zonename> uninstall zonecfg -z <zonename> delete To Delete a zone in a weird state: --------------------------------- If the install get interrupted, or the configuration has problems, the zone can end up in an incomplete state. In this state, it is difficult to uninstall or delete, or continue the configuration. To remove the incomplete zone and start fresh, do the following: 1. remove the zone entry in /etc/zones/index: global:installed:/ zone1:installed:/u01/zones/zone1 zone2:installed:/u01/zones/zone2 zone3:incomplete:/u01/zones/zone3 <----------- 2. delete the xml file associated with the zone under /etc/zones 3. delete the directory associated with the zone (if it has been created)

ข้อมูลจาก : http://www.camelrichard.org/topics/Solaris/Creating_a_Zone_in_Solaris_10
รายละเอียดเพิ่มเติม : Consolidating Server and Applications with Solaris Containers.pdf