<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Unwinding the Stack &#187; zones</title>
	<atom:link href="http://thestaticvoid.com/tag/zones/feed/" rel="self" type="application/rss+xml" />
	<link>http://thestaticvoid.com</link>
	<description>Explorations in Computing</description>
	<lastBuildDate>Wed, 07 Dec 2011 16:15:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Start Virtual NICs on OpenSolaris Boot</title>
		<link>http://thestaticvoid.com/post/2009/12/23/start-virtual-nics-on-opensolaris-boot/</link>
		<comments>http://thestaticvoid.com/post/2009/12/23/start-virtual-nics-on-opensolaris-boot/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 16:12:51 +0000</pubDate>
		<dc:creator>James Lee</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[crossbow]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[smf]]></category>
		<category><![CDATA[zones]]></category>

		<guid isPermaLink="false">http://thestaticvoid.com/?p=230</guid>
		<description><![CDATA[One of the more frustrating things I deal with on OpenSolaris is that every time I reboot, I have to manually bring up each virtual network interface in order to start all of my zones. There is a bug report for this problem that says a fix will be integrated into b132, which is just [...]]]></description>
			<content:encoded><![CDATA[<p>One of the more frustrating things I deal with on OpenSolaris is that every time I reboot, I have to manually bring up each virtual network interface in order to start all of my zones.  There is a <a href="http://bugs.opensolaris.org/view_bug.do?bug_id=6776009">bug report</a> for this problem that says a fix will be integrated into b132, which is just a few weeks away, but in the mean time, I&#8217;ve whipped up an SMF service to handle this for me.  Create a file <tt>vnic.xml</tt>:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #00bbdd;">&lt;!DOCTYPE service_bundle SYSTEM &quot;/usr/share/lib/xml/dtd/service_bundle.dtd.1&quot;&gt;</span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service_bundle</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'manifest'</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'vnic'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'network/vnic'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'service'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'network_service'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">grouping</span>=<span style="color: #ff0000;">'require_all'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">restart_on</span>=<span style="color: #ff0000;">'none'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'service'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service_fmri</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'svc:/network/service'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependent</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'network_vnic'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">grouping</span>=<span style="color: #ff0000;">'optional_all'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">restart_on</span>=<span style="color: #ff0000;">'none'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service_fmri</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'svc:/system/zones'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec_method</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'method'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'start'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">exec</span>=<span style="color: #ff0000;">'/usr/sbin/dladm up-vnic ${SMF_FMRI/*:/}'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">timeout_seconds</span>=<span style="color: #ff0000;">'60'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec_method</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'method'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'stop'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">exec</span>=<span style="color: #ff0000;">':true'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">timeout_seconds</span>=<span style="color: #ff0000;">'60'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property_group</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'startd'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'framework'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;propval</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'duration'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'astring'</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'transient'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property_group<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stability</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'Unstable'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;common_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;loctext</span> <span style="color: #000066;">xml:lang</span>=<span style="color: #ff0000;">'C'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Virtual Network Interface<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/loctext<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/common_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;documentation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;manpage</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">'dladm'</span> <span style="color: #000066;">section</span>=<span style="color: #ff0000;">'1M'</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">manpath</span>=<span style="color: #ff0000;">'/usr/share/man'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/documentation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service_bundle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>This service should run sometime after the network is started but before the zones are started.  Load it in with <tt>svccfg -v import vnic.xml</tt> and create an instance of the service for each of the VNICs that you want to start.  For example, if you want to start <tt>vnic0</tt> on boot:</p>
<pre class="terminal">
# <kbd>svccfg -s vnic add vnic0</kbd>
# <kbd>svcadm refresh vnic0</kbd>
# <kbd>svcadm enable vnic0</kbd>
</pre>
<p><strong>UPDATE:</strong> Build 132 is out an this functionality has been integrated as the <tt>svc:/network/datalink-management:default</tt> service.  The services that were added above can be removed by running <tt>svccfg delete vnic</tt>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thestaticvoid.com/post/2009/12/23/start-virtual-nics-on-opensolaris-boot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

