<?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>IT From All Angles</title>
	<atom:link href="http://blog.allanglesit.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.allanglesit.com</link>
	<description>The work of engineers, when properly applied, can have a compounding effect on the work of others...</description>
	<lastBuildDate>Mon, 04 Mar 2013 12:00:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Oracle Linux 6: Create an OCFS2 Cluster and Filesystem</title>
		<link>http://blog.allanglesit.com/2013/03/oracle-linux-6-create-an-ocfs2-cluster-and-filesystem/</link>
		<comments>http://blog.allanglesit.com/2013/03/oracle-linux-6-create-an-ocfs2-cluster-and-filesystem/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 12:00:34 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OCFS2]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[clustered file system]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ocfs2]]></category>
		<category><![CDATA[ocfs2-tools]]></category>
		<category><![CDATA[oracle linux]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1576</guid>
		<description><![CDATA[Today we are going to go through the process of creating a clustered file system on a pair of Oracle Linux 6.3 nodes.  This exercise is not very resource intensive.  I am using two VMs each with 1GB of RAM a single CPU and a shared virtual disk file in addition to the OS drivers. [...]]]></description>
				<content:encoded><![CDATA[<p>Today we are going to go through the process of creating a clustered file system on a pair of Oracle Linux 6.3 nodes.  This exercise is not very resource intensive.  I am using two VMs each with 1GB of RAM a single CPU and a shared virtual disk file in addition to the OS drivers.</p>
<p><strong>The Basic Concepts</strong></p>
<p>Now why is a clustered file system important?  So basically if you have the need to have a shared volume between two hosts, you can provision the disk to both machines, and everything could appear to work, however in the event that writes ever happened to the same areas of the disk at the same time you will end up with data corruption.  Now the key here is that you need a way to track locks from multiple nodes.  This is called a Distributed Locking Manager or DLM.  Now to get this DLM functionality working then it will create a cluster.  Valid cluster nodes can then mount the disk and interact with it as a normal disk.  So as part of OCFS2 we have two file systems which are created /sys/kernel/config and /dlm the prior is used for the cluster configurations, and the latter is for the distributed lock manager</p>
<p><strong>Requirements</strong></p>
<p>OCFS2 has been in the mainline Linux kernel for years, so it is widely available, though if you compile your own kernels then you will need to include support in your kernel.  Other than that all you need is the userland configuration tools to interact with it.</p>
<p><strong>Install OCFS2 Tools</strong></p>
<pre class="brush: plain; title: ; notranslate"># yum install ocfs2-tools</pre>
<p><strong>Load and Online the O2CB Service</strong></p>
<pre class="brush: plain; title: ; notranslate"># service o2cb load
Loading filesystem &quot;configfs&quot;: OK
Mounting configfs filesystem at /sys/kernel/config: OK
Loading stack plugin &quot;o2cb&quot;: OK
Loading filesystem &quot;ocfs2_dlmfs&quot;: OK
Creating directory '/dlm': OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK</pre>
<pre class="brush: plain; title: ; notranslate"># service o2cb online
Setting cluster stack &quot;o2cb&quot;: OK
Checking O2CB cluster configuration : Failed</pre>
<p>Notice that when we online o2cb, that it fails at checking the O2CB cluster configuration.  This is expected.  It is due to not having a cluster configuration to check at this point.</p>
<p><strong>Create the OCFS2 Cluster Configuration</strong></p>
<p>Now we need to create the /etc/ocfs2/cluster.conf.  This can be done with o2cb_ctl or manually.  Though it is considerably easier with o2cb_ctl.</p>
<pre class="brush: plain; title: ; notranslate"># o2cb_ctl -C -n prdcluster -t cluster -a name=prdcluster</pre>
<p>Here we are naming our cluster prdcluster.  The cluster itself doesn&#8217;t know anything about nodes until we add them in the next step.</p>
<p><strong>Add Nodes to the OCFS2 Cluster Configuration</strong></p>
<p>Create an entry for each node, using the below command.  We will need the IP of the nodes, the port, the cluster name we defined before and the host name of each node.</p>
<pre class="brush: plain; title: ; notranslate"># o2cb_ctl -C -n ocfs01 -t node -a number=0 -a ip_address=172.16.88.131 -a ip_port=11111 -a cluster=prdcluster
# o2cb_ctl -C -n ocfs02 -t node -a number=1 -a ip_address=172.16.88.132 -a ip_port=11111 -a cluster=prdcluster</pre>
<p>The IP Address and Port are used for the Cluster heartbeat.  The node name is used to verify a cluster member when attempting to join the cluster.  The node name needs to match the systems host name.</p>
<p><strong>Review the OCFS2 Cluster Configuration</strong></p>
<p>Now we can take a peek at the cluster.conf which our o2cb_ctl command created.</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/ocfs2/cluster.conf
node:
name = ocfs01
cluster = prdcluster
number = 0
ip_address = 172.16.88.131
ip_port = 11111

node:
name = ocfs02
cluster = prdcluster
number = 1
ip_address = 172.16.88.132
ip_port = 11111

cluster:
name = prdcluster
heartbeat_mode = local
node_count = 2</pre>
<p><strong>Configure the O2CB Service</strong></p>
<p>In order to have the cluster start with the correct information we need to update the o2cb service and include the name of our cluster.</p>
<pre class="brush: plain; title: ; notranslate"># service o2cb configure
Configuring the O2CB driver.

This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot.  The current values will be shown in brackets ('[]').  Hitting
&lt;ENTER&gt; without typing an answer will keep that current value.  Ctrl-C
will abort.

Load O2CB driver on boot (y/n) [n]: y
Cluster stack backing O2CB [o2cb]:
Cluster to start on boot (Enter &quot;none&quot; to clear) [ocfs2]: prdcluster
Specify heartbeat dead threshold (&gt;=7) [31]:
Specify network idle timeout in ms (&gt;=5000) [30000]:
Specify network keepalive delay in ms (&gt;=1000) [2000]:
Specify network reconnect delay in ms (&gt;=2000) [2000]:
Writing O2CB configuration: OK
Setting cluster stack &quot;o2cb&quot;: OK
Registering O2CB cluster &quot;prdcluster&quot;: OK
Setting O2CB cluster timeouts : OK</pre>
<p><strong>Offline and Online the O2CB Service</strong></p>
<p>To ensure that everything is working as we expect, I like to offline and online the service.</p>
<pre class="brush: plain; title: ; notranslate"># service o2cb offline
Clean userdlm domains: OK
Stopping O2CB cluster prdcluster: Unregistering O2CB cluster &quot;prdcluster&quot;: OK</pre>
<p>We just want to watch that it is unregistering and registering the correct cluster, in this case the prdcluster.</p>
<pre class="brush: plain; title: ; notranslate"># service o2cb online
Setting cluster stack &quot;o2cb&quot;: OK
Registering O2CB cluster &quot;prdcluster&quot;: OK
Setting O2CB cluster timeouts : OK</pre>
<p><strong>Repeat for All Nodes</strong></p>
<p>All of the above actions need to be done on all nodes in the cluster, with no variations.  Once all nodes are Registering O2CB cluster &#8220;prdcluster&#8221;: OK then you can move on.</p>
<p><strong>Format Our Shared Disk</strong></p>
<p>This part is no different from any other format, keep in mind that once you have formatted the disk on one cluster node, it does not need to be done on the other node.</p>
<pre class="brush: plain; title: ; notranslate"># mkfs.ocfs2 /dev/xvdb
mkfs.ocfs2 1.8.0
Cluster stack: classic o2cb
Label:
Features: sparse extended-slotmap backup-super unwritten inline-data strict-journal-super xattr indexed-dirs refcount discontig-bg
Block size: 4096 (12 bits)
Cluster size: 4096 (12 bits)
Volume size: 53687091200 (13107200 clusters) (13107200 blocks)
Cluster groups: 407 (tail covers 11264 clusters, rest cover 32256 clusters)
Extent allocator size: 8388608 (2 groups)
Journal size: 268435456
Node slots: 8
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 3 block(s)
Formatting Journals: done
Growing extent allocator: done
Formatting slot map: done
Formatting quota files: done
Writing lost+found: done
mkfs.ocfs2 successful</pre>
<p><strong>Mount Our OCFS2 Volume</strong></p>
<p>You can either use a manual issuance of the mount command, or you can create an entry in the /etc/fstab</p>
<pre class="brush: plain; title: ; notranslate"># mount -t ocfs2 /dev/xvdb /d01/share</pre>
<pre class="brush: plain; title: ; notranslate"># cat /etc/fstab

#
 # /etc/fstab
 # Created by anaconda on Wed Feb 27 13:44:01 2013
 #
 # Accessible filesystems, by reference, are maintained under '/dev/disk'
 # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
 #
 /dev/mapper/vg_system-lv_root /                       ext4    defaults        1 1
 UUID=4b397e61-7954-40e9-943f-8385e46d263d /boot                   ext4    defaults        1 2
 /dev/mapper/vg_system-lv_swap swap                    swap    defaults        0 0
 tmpfs                   /dev/shm                tmpfs   defaults        0 0
 devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
 sysfs                   /sys                    sysfs   defaults        0 0
 proc                    /proc                   proc    defaults        0 0
 /dev/xvdb        /d01/share        ocfs2    defaults    1 1</pre>
<p>Then mount our entry from the /etc/fstab.</p>
<pre class="brush: plain; title: ; notranslate"># mount /d01/share</pre>
<p>Mounts will need to be configured on all cluster nodes.</p>
<p><strong>Check Our Mounts</strong></p>
<p>Once we have mounted our devices we need to ensure that they are showing up correctly.</p>
<pre class="brush: plain; title: ; notranslate"># mount
 /dev/mapper/vg_system-lv_root on / type ext4 (rw)
 proc on /proc type proc (rw)
 sysfs on /sys type sysfs (rw)
 devpts on /dev/pts type devpts (rw,gid=5,mode=620)
 tmpfs on /dev/shm type tmpfs (rw)
 /dev/xvda1 on /boot type ext4 (rw)
 none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
 sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
 configfs on /sys/kernel/config type configfs (rw)
 ocfs2_dlmfs on /dlm type ocfs2_dlmfs (rw)
 /dev/xvdb on /d01/share type ocfs2 (rw,_netdev,heartbeat=local)</pre>
<p>Notice that /d01/share is mounted as ocfs2, and that it is mounted with rw, _netdev, heartbeat=local.  These are the expected options (these are gathered from the previous configuration).</p>
<p><strong>Check Service Status</strong></p>
<p>Finally we can check the status on the o2cb service and we can see information about our cluster, heartbeat and the various other mounts that are needed to maintain the cluster (configfs, and ocfs2_dlmfs).</p>
<pre class="brush: plain; title: ; notranslate"># service o2cb status
 Driver for &quot;configfs&quot;: Loaded
 Filesystem &quot;configfs&quot;: Mounted
 Stack glue driver: Loaded
 Stack plugin &quot;o2cb&quot;: Loaded
 Driver for &quot;ocfs2_dlmfs&quot;: Loaded
 Filesystem &quot;ocfs2_dlmfs&quot;: Mounted
 Checking O2CB cluster &quot;prdcluster&quot;: Online
 Heartbeat dead threshold: 31
 Network idle timeout: 30000
 Network keepalive delay: 2000
 Network reconnect delay: 2000
 Heartbeat mode: Local
 Checking O2CB heartbeat: Active</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/03/oracle-linux-6-create-an-ocfs2-cluster-and-filesystem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle VM 3: Connecting to MySQL Backend</title>
		<link>http://blog.allanglesit.com/2013/02/oracle-vm-3-connecting-to-mysql-backend/</link>
		<comments>http://blog.allanglesit.com/2013/02/oracle-vm-3-connecting-to-mysql-backend/#comments</comments>
		<pubDate>Wed, 13 Feb 2013 12:00:51 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Oracle VM]]></category>
		<category><![CDATA[blobs]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[oracle vm]]></category>
		<category><![CDATA[oracle vm 3]]></category>
		<category><![CDATA[ovm]]></category>
		<category><![CDATA[ovm3]]></category>
		<category><![CDATA[schema]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1395</guid>
		<description><![CDATA[Starting in Oracle VM 3.2.1 the built in database of the Oracle VM Manager was MySQL.  I had hoped that this change would also signal a change in the database schema.  In prior versions of OVM 3.x all data was populated in the database in a completely useless longblob form. As we can see it [...]]]></description>
				<content:encoded><![CDATA[<p>Starting in Oracle VM 3.2.1 the built in database of the Oracle VM Manager was MySQL.  I had hoped that this change would also signal a change in the database schema.  In prior versions of OVM 3.x all data was populated in the database in a completely useless longblob form.</p>
<pre class="brush: plain; title: ; notranslate"># mysql ovs  -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'</pre>
<p>As we can see it is attempting and failing to use /var/lib/mysql/mysql.sock as the connection.  So lets take a look at the process and see if it has any clues.</p>
<pre class="brush: plain; title: ; notranslate"># ps -ef | grep mysql
oracle    2234  1778  1 Jan23 ?        00:47:09 /usr/sbin/mysqld --defaults-file=/u01/app/oracle/mysql/data/my.cnf --basedir=/usr --datadir=/u01/app/oracle/mysql/data --plugin-dir=/usr/lib64/mysql/plugin --user=oracle --log-error=/u01/app/oracle/mysql/data/mysqld.err --pid-file=/u01/app/oracle/mysql/data/mysqld.pid --socket=/u01/app/oracle/mysql/data/mysqld.sock --port=49500</pre>
<p>Above we see a couple of key pieces of information.  We now know that the socket is /u01/app/oracle/mysql/data/mysqld.sock and we also see that our configuration file is /u01/app/oracle/mysql/data/my.cnf.  So based on this new socket we can attempt to connect to mysql again.</p>
<pre class="brush: plain; title: ; notranslate"># mysql ovs -S /u01/app/oracle/mysql/data/mysqld.sock -u root -p
Enter password:
mysql&gt;
</pre>
<p>Now we are connected to the backend, here comes the bad news.  The database is completely worthless, they are still using longblobs for everything.</p>
<pre class="brush: plain; title: ; notranslate">mysql&gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| ovs                |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)</pre>
<p>Use the ovs database so we can look at its content.</p>
<pre class="brush: plain; title: ; notranslate">mysql&gt; use ovs;
Database changed</pre>
<p>Next we will show all tables so that we can get an idea of what the schema looks like.</p>
<pre class="brush: plain; title: ; notranslate">mysql&gt; show tables;
+--------------------------------+
| Tables_in_ovs                  |
+--------------------------------+
| Mgr_AbcStore                   |
| Mgr_AccessManager              |
| Mgr_ActionEngineProperties     |
| Mgr_ActionManager              |
| Mgr_ArchiveManager             |
| Mgr_BackupManager              |
| Mgr_BalancerControl            |
| Mgr_BindingMismatchEvent       |
| Mgr_BondPort                   |
| Mgr_BusinessManager            |
| Mgr_Cluster                    |
| Mgr_Coherence                  |
| Mgr_ControlDomain              |
| Mgr_CpuCompatibilityGroup      |
| Mgr_CreateStatisticLog         |
| Mgr_CreatedEvent               |
| Mgr_DeletedEvent               |
| Mgr_DiscoverEngineProperties   |
| Mgr_DiscoverManager            |
| Mgr_EthernetNetwork            |
| Mgr_EthernetPort               |
| Mgr_EventEngineProperties      |
| Mgr_EventLog                   |
| Mgr_EventManager               |
| Mgr_FibreChannelStorageArray   |
| Mgr_FileManager                |
| Mgr_FileSystemMount            |
| Mgr_FileSystemPlugin           |
| Mgr_Foundry                    |
| Mgr_HashMap                    |
| Mgr_InformationalEvent         |
| Mgr_InternalJob                |
| Mgr_InternalPort               |
| Mgr_InternalSystemLog          |
| Mgr_InternalTaggingObject      |
| Mgr_IscsiStorageArray          |
| Mgr_IscsiStorageInitiator      |
| Mgr_Iterator                   |
| Mgr_JobConstructingEvent       |
| Mgr_JobDoneEvent               |
| Mgr_JobRunningEvent            |
| Mgr_LinkedList                 |
| Mgr_LocalFileServer            |
| Mgr_LocalFileSystem            |
| Mgr_LocalStorageArray          |
| Mgr_LocalStorageInitiator      |
| Mgr_LocalStoragePath           |
| Mgr_LogEngineProperties        |
| Mgr_LogManager                 |
| Mgr_LogStore                   |
| Mgr_ModelEngineProperties      |
| Mgr_ModelManager               |
| Mgr_NetworkFileServer          |
| Mgr_NetworkFileSystem          |
| Mgr_NetworkSelectionManager    |
| Mgr_ObjectChangeEvent          |
| Mgr_ObjectCheckerTask          |
| Mgr_OdofManager                |
| Mgr_OvfAssembly                |
| Mgr_PathDownEvent              |
| Mgr_PathUpEvent                |
| Mgr_PerfManager                |
| Mgr_PortDownEvent              |
| Mgr_PortUpEvent                |
| Mgr_Processor                  |
| Mgr_Properties                 |
| Mgr_QueuedJobCreateEvent       |
| Mgr_QueuedServerUpdateNtpServe |
| Mgr_QueuedServerYumRepositoryU |
| Mgr_RasEngineProperties        |
| Mgr_RasManager                 |
| Mgr_RefreshRepoFileSystemsTask |
| Mgr_Repository                 |
| Mgr_RestoreManager             |
| Mgr_RoleService                |
| Mgr_RootStatisticLog           |
| Mgr_RulesEngineProperties      |
| Mgr_RulesManager               |
| Mgr_SchedulableTaskProperties  |
| Mgr_Server                     |
| Mgr_ServerClusterStateDownEven |
| Mgr_ServerDefaultInfo          |
| Mgr_ServerDisconnectErrorEvent |
| Mgr_ServerDiscoverScanEvent    |
| Mgr_ServerNotification         |
| Mgr_ServerOfflineEvent         |
| Mgr_ServerOutofDateEvent       |
| Mgr_ServerPool                 |
| Mgr_ServerPoolMasterMissingEve |
| Mgr_ServerRunningEvent         |
| Mgr_ServerSelectionManager     |
| Mgr_ServerStartingEvent        |
| Mgr_ServerStoppedEvent         |
| Mgr_ServerUserMissingEvent     |
| Mgr_ServerVersionMismatchWarni |
| Mgr_ServerYumRepositoryInforma |
| Mgr_ServerYumUpdateCheckingEve |
| Mgr_SeverityChangeEvent        |
| Mgr_StatisticManager           |
| Mgr_StatisticSubjectLog        |
| Mgr_StatisticTypeLog           |
| Mgr_StatsIntervalAdjusterTask  |
| Mgr_StorageArrayPlugin         |
| Mgr_StorageDeviceUpEvent       |
| Mgr_StorageElement             |
| Mgr_StorageSelectionManager    |
| Mgr_Tag                        |
| Mgr_TaskEngineProperties       |
| Mgr_TaskManager                |
| Mgr_TreeMap                    |
| Mgr_TreeStore                  |
| Mgr_User                       |
| Mgr_UserAccount                |
| Mgr_UserStore                  |
| Mgr_VirtualCdrom               |
| Mgr_VirtualDisk                |
| Mgr_VirtualMachine             |
| Mgr_VirtualMachineCfgFile      |
| Mgr_VirtualMachineDisconnectEr |
| Mgr_VirtualMachineRunningEvent |
| Mgr_VirtualMachineStartingEven |
| Mgr_VirtualMachineStoppedEvent |
| Mgr_VirtualMachineStoppingEven |
| Mgr_VirtualMachineSuspendedEve |
| Mgr_VirtualMachineTemplate     |
| Mgr_VmApiMessages              |
| Mgr_VmCloneDefinition          |
| Mgr_VmCloneNetworkMapping      |
| Mgr_VmCloneStorageMapping      |
| Mgr_VmDiskMapping              |
| Mgr_VmSelectionManager         |
| Mgr_Vnic                       |
| Mgr_VnicManager                |
| Mgr_VnicManagerProperties      |
| Mgr_VolumeGroup                |
| Mgr_XenHypervisor              |
| Mgr_YumRepoOutofDateEvent      |
| Mgr_YumUpdateCheckerTask       |
| Odof_id_to_type                |
| Odof_not_tabled                |
| Odof_sys_properties            |
| Odof_type_to_class             |
| WL_LLR_ADMINSERVER             |
+--------------------------------+
143 rows in set (0.00 sec)</pre>
<p>Now lets look at the columns of the Mgr_VirtualMachine table.</p>
<pre class="brush: plain; title: ; notranslate">mysql&gt; describe Mgr_VirtualMachine;
+--------+------------+------+-----+---------+-------+
| Field  | Type       | Null | Key | Default | Extra |
+--------+------------+------+-----+---------+-------+
| m_id   | bigint(20) | NO   | PRI | 0       |       |
| m_data | longblob   | YES  |     | NULL    |       |
+--------+------------+------+-----+---------+-------+
2 rows in set (0.00 sec)</pre>
<p>Now lets look at the columns of the Mgr_Server table.</p>
<pre class="brush: plain; title: ; notranslate">mysql&gt; describe Mgr_Server;
+--------+------------+------+-----+---------+-------+
| Field  | Type       | Null | Key | Default | Extra |
+--------+------------+------+-----+---------+-------+
| m_id   | bigint(20) | NO   | PRI | 0       |       |
| m_data | longblob   | YES  |     | NULL    |       |
+--------+------------+------+-----+---------+-------+
2 rows in set (0.00 sec)</pre>
<p>Here is a command to pull the whole schema, and every single table has two tables, m_id and m_data with the m_data being longblog.</p>
<pre class="brush: plain; title: ; notranslate">mysqldump --no-data ovs -S /u01/app/oracle/mysql/data/mysqld.sock -u root -p</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/02/oracle-vm-3-connecting-to-mysql-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris 11: Installing MySQL</title>
		<link>http://blog.allanglesit.com/2013/02/solaris-11-installing-mysql/</link>
		<comments>http://blog.allanglesit.com/2013/02/solaris-11-installing-mysql/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 12:00:21 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[ips]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[pkg]]></category>
		<category><![CDATA[solaris11]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1351</guid>
		<description><![CDATA[Recently I have been spending some time learning about database technologies (Oracle Databases at Keste as well as MySQL on my own).  Part of this I have decided to carry over into my existing work with Solaris, and go through the installation process using the Image Packaging System which is in Solaris.  Now really the [...]]]></description>
				<content:encoded><![CDATA[<p>Recently I have been spending some time learning about database technologies (Oracle Databases at Keste as well as MySQL on my own).  Part of this I have decided to carry over into my existing work with Solaris, and go through the installation process using the Image Packaging System which is in Solaris.  Now really the IPS does all the heavy lifting for us, but we still need to know how to utilize the package manager to get the desired result.</p>
<p><strong>Searching for the MySQL Package</strong></p>
<p>Now when we search using the below command, you will notice that we are using the parameter -r this tells it to use the remote repository in addition to the local repository, this allows us to find software that we do not have installed on the machine.</p>
<pre class="brush: plain; title: ; notranslate"># pkg search -r mysql
INDEX       ACTION VALUE                                                                   PACKAGE
pkg.summary set    A MySQL database adapter for the Python programming language            pkg:/library/python-2/python-mysql-26@1.2.2-0.175.1.0.0.11.0
pkg.summary set    Apache Portable Runtime Utility (APR-util) 1.3 DBD Driver for MySQL 5.0 pkg:/library/apr-util-13/dbd-mysql@1.3.9-0.175.1.0.0.24.0
pkg.summary set    MySQL Database Management System (Base)                                 pkg:/database/mysql-common@0.5.11-0.175.1.0.0.24.0
pkg.summary set    MySQL extension module for PHP                                          pkg:/web/php-53/extension/php-mysql@5.3.14-0.175.1.0.0.24.0
pkg.summary set    MySQL extension module for PHP                                          pkg:/web/php-52/extension/php-mysql@5.2.17-0.175.1.0.0.24.0
pkg.summary set    MySQL 5.1 Database Management System                                    pkg:/database/mysql-51@5.1.37-0.175.1.0.0.24.0
pkg.summary set    MySQL 5.1 libraries                                                     pkg:/database/mysql-51/library@5.1.37-0.175.1.0.0.24.0
pkg.summary set    MySQL 5.1 tests                                                         pkg:/database/mysql-51/tests@5.1.37-0.175.1.0.0.24.0
basename    file   usr/mysql/5.1/bin/amd64/mysql                                           pkg:/database/mysql-51@5.1.37-0.175.1.0.0.24.0
basename    file   usr/mysql/5.1/bin/mysql                                                 pkg:/database/mysql-51@5.1.37-0.175.1.0.0.24.0
basename    file   usr/mysql/5.1/bin/sparcv9/mysql                                         pkg:/database/mysql-51@5.1.37-0.175.1.0.0.24.0
name        group  mysql                                                                   pkg:/database/mysql-common@0.5.11-0.175.1.0.0.24.0
basename    link   usr/bin/mysql                                                           pkg:/database/mysql-51@5.1.37-0.175.1.0.0.24.0
name        user   mysql                                                                   pkg:/database/mysql-common@0.5.11-0.175.1.0.0.24.0
basename    dir    etc/mysql                                                               pkg:/database/mysql-51@5.1.37-0.175.1.0.0.24.0
basename    dir    usr/mysql                                                               pkg:/database/mysql-51@5.1.37-0.175.1.0.0.24.0
basename    dir    usr/mysql/5.1/include/mysql                                             pkg:/database/mysql-51@5.1.37-0.175.1.0.0.24.0
basename    dir    usr/mysql/5.1/share/mysql                                               pkg:/database/mysql-51@5.1.37-0.175.1.0.0.24.0
basename    dir    var/mysql                                                               pkg:/database/mysql-51@5.1.37-0.175.1.0.0.24.0
basename    dir    usr/mysql                                                               pkg:/database/mysql-51/library@5.1.37-0.175.1.0.0.24.0
basename    dir    usr/mysql/5.1/lib/amd64/mysql                                           pkg:/database/mysql-51/library@5.1.37-0.175.1.0.0.24.0
basename    dir    usr/mysql/5.1/lib/mysql                                                 pkg:/database/mysql-51/library@5.1.37-0.175.1.0.0.24.0
basename    dir    usr/mysql/5.1/lib/sparcv9/mysql                                         pkg:/database/mysql-51/library@5.1.37-0.175.1.0.0.24.0
basename    dir    usr/mysql                                                               pkg:/database/mysql-51/tests@5.1.37-0.175.1.0.0.24.0</pre>
<p>Now in the output we are looking for a pkg.summary which is the software we are looking for, in our case pkg:/database/mysql-51 or simply mysql-51.</p>
<p>Once we think we have the right package I like to do a pkg info to make sure that it is what I expect, again here we want to look against remote repositories as well with the -r parameter.</p>
<pre class="brush: plain; title: ; notranslate"># pkg info -r mysql-51
Name: database/mysql-51
Summary: MySQL 5.1 Database Management System
Category: Development/Databases
State: Not installed
Publisher: solaris
Version: 5.1.37
Build Release: 5.11
Branch: 0.175.1.0.0.24.0
Packaging Date: September  4, 2012 05:09:22 PM
Size: 147.23 MB
FMRI: pkg://solaris/database/mysql-51@5.1.37,5.11-0.175.1.0.0.24.0:20120904T170922Z</pre>
<p><strong>Install the MySQL Package</strong></p>
<p>Here we can install MySQL 5.1 via the IPS repositories.</p>
<pre class="brush: plain; title: ; notranslate"># pkg install mysql-51
Packages to install:  2
Create boot environment: No
Create backup boot environment: No
Services to change:  2

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                2/2       252/252    52.2/52.2 16.3M/s

PHASE                                          ITEMS
Installing new actions                       343/343
Updating package state database                 Done
Updating image state                            Done
Creating fast lookup database                   Done </pre>
<p><strong>Enable the MySQL Service</strong></p>
<p>Now lets take a look at the service.  We can see that the service is installed but disabled.</p>
<pre class="brush: plain; title: ; notranslate"># svcs -a | grep mysql
disabled       10:28:40 svc:/application/database/mysql:version_51</pre>
<p>Enable the service.</p>
<pre class="brush: plain; title: ; notranslate"># svcadm enable mysql
# svcs -a | grep mysql
online         10:30:26 svc:/application/database/mysql:version_51</pre>
<p><strong>Connect to MySQL</strong></p>
<pre class="brush: plain; title: ; notranslate"># mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.37 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql&amp;gt;</pre>
<p>Please note this is not a secure MySQL configuration.  You will need to secure this before use.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/02/solaris-11-installing-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL: Describe All Tables</title>
		<link>http://blog.allanglesit.com/2013/02/mysql-describe-all-tables/</link>
		<comments>http://blog.allanglesit.com/2013/02/mysql-describe-all-tables/#comments</comments>
		<pubDate>Mon, 11 Feb 2013 12:00:50 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1393</guid>
		<description><![CDATA[In MySQL if you want to find out what columns are in a given table, you can describe the table and it will show you the columns and the data types associated with that column.  However if you need to do this for a large number of tables, it can get a bit repetitive. Connect [...]]]></description>
				<content:encoded><![CDATA[<p>In MySQL if you want to find out what columns are in a given table, you can describe the table and it will show you the columns and the data types associated with that column.  However if you need to do this for a large number of tables, it can get a bit repetitive.</p>
<p><strong>Connect to MySQL</strong></p>
<pre class="brush: plain; title: ; notranslate"># mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.1.37 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.</pre>
<p><strong>Show the Available Databases</strong></p>
<pre class="brush: plain; title: ; notranslate">mysql&gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| TST               |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.00 sec)</pre>
<p><strong>Use the TST Database</strong></p>
<p>Our example lives on the TST database.</p>
<pre class="brush: plain; title: ; notranslate">mysql&gt; use TST;
Database changed</pre>
<p><strong>List All Tables on TST</strong></p>
<pre class="brush: plain; title: ; notranslate">mysql&gt; show tables;
+-------------------+
| Tables_in_TST     |
+-------------------+
| customer          |
| product           |
+-------------------+
2 rows in set (0.00 sec)</pre>
<p><strong>Describe the Customer Table</strong></p>
<pre class="brush: plain; title: ; notranslate">mysql&gt; describe customer;
+-------------+-----------------------+------+-----+---------+----------------+
| Field       | Type                  | Null | Key | Default | Extra          |
+-------------+-----------------------+------+-----+---------+----------------+
| customer_id | mediumint(8) unsigned | NO   | PRI | NULL    | auto_increment |
| first_name  | varchar(30)           | NO   |     | NULL    |                |
| last_name   | varchar(30)           | NO   |     | NULL    |                |
| email       | varchar(30)           | NO   |     | NULL    |                |
+-------------+-----------------------+------+-----+---------+----------------+
4 rows in set (0.01 sec)</pre>
<p><strong>Describe the Product Table</strong></p>
<pre class="brush: plain; title: ; notranslate">mysql&gt; describe product;
+--------------+--------------+------+-----+---------+-------+
| Field        | Type         | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| product_id   | mediumint(8) | YES  |     | NULL    |       |
| product_name | varchar(100) | YES  |     | NULL    |       |
+--------------+--------------+------+-----+---------+-------+
2 rows in set (0.00 sec)</pre>
<p>Now just wash rinse and repeat for all tables&#8230;  OR</p>
<p><strong>The Easy Way</strong></p>
<p>No sense in killing ourselves.  Lets use a tool that does the heavy lifting for us.</p>
<pre class="brush: plain; title: ; notranslate"># mysqldump --no-data TST -u root
-- MySQL dump 10.13  Distrib 5.1.37, for pc-solaris2.11 (i386)
--
-- Host: localhost    Database: TST
-- ------------------------------------------------------
-- Server version       5.1.37

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `customer`
--

DROP TABLE IF EXISTS `customer`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer` (
`customer_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
PRIMARY KEY (`customer_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `product`
--

DROP TABLE IF EXISTS `product`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product` (
`product_id` mediumint(8) DEFAULT NULL,
`product_name` varchar(100) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2013-02-05 16:12:23</pre>
<p>Now we can spend our time interpreting and understanding the output instead of trying to recurse through every table in the database.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/02/mysql-describe-all-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OVMCLI: Standardize the Naming of Virtual Disks</title>
		<link>http://blog.allanglesit.com/2013/02/ovmcli-standardize-the-naming-of-virtual-disks/</link>
		<comments>http://blog.allanglesit.com/2013/02/ovmcli-standardize-the-naming-of-virtual-disks/#comments</comments>
		<pubDate>Wed, 06 Feb 2013 12:00:42 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Oracle VM]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[has-code]]></category>
		<category><![CDATA[oracle vm]]></category>
		<category><![CDATA[oracle vm 3]]></category>
		<category><![CDATA[ovm]]></category>
		<category><![CDATA[ovm3]]></category>
		<category><![CDATA[ovmcli]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1453</guid>
		<description><![CDATA[Today we are going over a script I wrote to utilize the ovmcli to rename all virtual disks to follow a understandable standard, in this case we will take the vmname and append a disk identifier to it.  The first disk (slot 0) will be appended with &#8220;_system.img&#8221; with all subsequent being appended with &#8220;_dataX.img&#8221; [...]]]></description>
				<content:encoded><![CDATA[<p>Today we are going over a script I wrote to utilize the ovmcli to rename all virtual disks to follow a understandable standard, in this case we will take the vmname and append a disk identifier to it.  The first disk (slot 0) will be appended with &#8220;_system.img&#8221; with all subsequent being appended with &#8220;_dataX.img&#8221; where X is the slot number.  This is a pretty simple script, but depending on the size of your environment it could take a significant amount of time to do a run in your environment due to the number of calls that you need to make to the OVM Manager.</p>
<p>I have built in a few parameters.  We need to provide the OVM 3.x Manager server name, additionally we can provide the port, and username.  Both of which have default values.  Additionally I have added a dry run parameter which will give you the chance to see what the output would be.  Finally there is a verbose parameter which is self explanatory.</p>
<p>Please keep in mind that in OVM 3.x vdisk names are simple metadata.  This doesn&#8217;t change any names on disk.  But this does help when you have taken the time to name your vdisks when creating the VMs but have had to re-manage a hypervisor, as in that scenario you end up being able to rediscover the VMs themselves, and their names, but the vdisks will come up as named their UUID.</p>
<p>Please keep in mind that this script will make multiple SSH connections to the ovmcli, as such you will want to use keys to streamline this authentication.  I have an article covering that <a title="Oracle VM 3: Enable Key Based Authentication to OVM CLI" href="http://blog.allanglesit.com/2013/01/oracle-vm-3-enable-key-based-authentication-to-ovm-cli/">here</a>.</p>
<p>Name       : rename-vdisks.sh<br />
Version   :  1.2.1<br />
MD5        :  c1a0cf9935a4cdcfd12f3eda71bfdd5d<br />
SHA256  :  bd96192e20e5371b0124eec1c8372c97dbf8469b2c5538400461b82d7f43f5e2<br />
URL         :  <a href="http://source.allanglesit.net/pub/rename-vdisks.sh">http://source.allanglesit.net/pub/rename-vdisks.sh</a></p>
<pre class="brush: bash; collapse: true; first-line: 1; gutter: true; light: false; title: Expand rename-vdisks.sh; toolbar: true; notranslate">#!/bin/bash
# chkconfig:
# description:
#
#: Script Name    : rename-vdisks.sh
#: Version    : 1.2.1
#: Author    : Matthew Mattoon - http://blog.allanglesit.com
#: Date Created    : January 26, 2013
#: Date Updated    : February 20, 2013
#: Description    : Renames all OVM 3.x virtual disks to a standard naming convention.
#: Examples    : rename-vdisks.sh -m OVMMANAGER -p PORT -u USER -v
#:         : rename-vdisks.sh -m ovmserver.localdomain -v

usage()
{
cat &lt;&lt; EOF
usage: $0 options

This script allows you to rename all OVM 3.x virtual disks to follow a consistent standard.

Standard:    vmname_system.img (slot 0)
vmname_dataX.img (slot 1-x where X is the slot number)
vmname1_vmname2_dataX.img (where a disk is shared between 2 VMs)

OPTIONS:
-h    Show this message
-m    OVM 3.x Manager Server (required).
-p    OVM 3.x Manager Port (default: 10000).
-u    OVM 3.x Manager User (default: admin).
-d   Dry Run.  Script will make no changes, but instead provide the output of an actual run.
-v   Verbose flag.
EOF
}

while getopts &quot;hm:pudv&quot; OPTION
do
case $OPTION in
h) usage; exit 1;;
m) ovmmgr=$OPTARG;;
p) ovmport=$OPTARG;;
u) ovmuser=$OPTARG;;
d) dryrun=1;;
v) verbose=1;;
?) usage; exit 1;;
esac
done

if [[ -z $ovmmgr ]]
then
usage
exit 1
fi

echo &quot;&quot;

if [[ -z $ovmuser ]]
then
ovmuser=admin
echo &quot;Using default OVM User [ $ovmuser ]&quot;
fi

if [[ -z $ovmport ]]
then
ovmport=10000
echo &quot;Using default OVM Port [ $ovmport ]&quot;
fi

if [ &quot;$dryrun&quot; = &quot;1&quot; ]
then
echo &quot;Using Dry Run Option&quot;
fi

if [ &quot;$verbose&quot; = &quot;1&quot; ]
then
echo &quot;Using Verbose Option&quot;
fi

echo &quot;&quot;
echo &quot;&quot;
echo `sed -n 3p $0 | sed 's/#://'`
echo `sed -n 5p $0 | sed 's/#://'`
echo `sed -n 4p $0 | sed 's/#://'`
echo &quot;&quot;
echo &quot;&quot;

for i in `ssh -p $ovmport $ovmuser@$ovmmgr &quot;list vmdiskmapping&quot; | grep -v 'OVM&gt;\|Command:\|Status:\|Time:\|Data:' | sed 's/  /:/g'`
do
id=`echo $i | cut -d &quot;:&quot; -f 3`
echo &quot;Examining $id  &quot;
read name id slot emdev vdisk vm &lt;&lt;&lt;$(ssh -p $ovmport $ovmuser@$ovmmgr &quot;show vmdiskmapping id=$id&quot; | grep -v 'OVM&gt;\|Command:\|Status:\|Time:\|Data:' | sed 's/Emulated Block Device/EmulatedBlockDevice/' | sed 's/Virtual Disk Id/VirtualDiskId/' | sed 's/Vm Id/VmId/' | sed 's/  //' | sed 's/ = /=/g' | sed 's/  \[/:\[/g')
name=`echo $name | cut -d = -f 2`
id=`echo $id | cut -d = -f 2`
slot=`echo $slot | cut -d = -f 2`
emdev=`echo $emdev | cut -d = -f 2`
vdiskid=`echo $vdisk | cut -d = -f 2 | cut -d &quot;:&quot; -f 1`
vdiskname=`echo $vdisk | cut -d = -f 2 | cut -d &quot;:&quot; -f 2 | sed 's/\[\|\]//g'`
vm=`echo $vm | cut -d = -f 2 | cut -d &quot;:&quot; -f 2 | sed 's/\[\|\]//g'`
if [ &quot;$slot&quot; != &quot;0&quot; ]
then
slotname=data&quot;$slot&quot;.img
else
slotname=system.img
fi
newvdiskname=&quot;$vm&quot;_&quot;$slotname&quot;

imginfo=( `ssh -p $ovmport $ovmuser@$ovmmgr &quot;show virtualdisk id=$vdiskid&quot; | grep -v 'OVM&gt;\|Command:\|Status:\|Time:\|Data:' | sed 's/Max (GiB)/Max(GiB)/' | sed 's/Used (GiB)/Used(GiB)/' | sed 's/Repository Id/RepositoryId/' | sed 's/Vm /Vm/' | sed 's/  //' | sed 's/ = /=/g' | sed 's/  \[/:\[/g'` )
imgname=`printf &quot;%s\n&quot; &quot;${imginfo[0]}&quot; | cut -d = -f 2`
imgid=`printf &quot;%s\n&quot; &quot;${imginfo[1]}&quot; | cut -d = -f 2`
imgmaxsize=`printf &quot;%s\n&quot; &quot;${imginfo[2]}&quot; | cut -d = -f 2`
imgusedsize=`printf &quot;%s\n&quot; &quot;${imginfo[3]}&quot; | cut -d = -f 2`
imgshareable=`printf &quot;%s\n&quot; &quot;${imginfo[4]}&quot; | cut -d = -f 2`
imgrepoid=`printf &quot;%s\n&quot; &quot;${imginfo[5]}&quot; | cut -d = -f 2 | cut -d : -f 1`
imgreponame=`printf &quot;%s\n&quot; &quot;${imginfo[5]}&quot; | cut -d = -f 2 | cut -d : -f 2 | sed 's/\[\|\]//g'`
if [ &quot;$verbose&quot; = &quot;1&quot; ]
then
echo &quot;  VM Name         :  $vm&quot;
echo &quot;  Disk Id         :  $vdiskid&quot;
echo &quot;  Disk Name       :  $vdiskname&quot;
echo &quot;  Slot Number     :  $slot&quot;
echo &quot;  Shareable       :  $imgshareable&quot;
fi
if [ -n &quot;$vdiskid&quot; -o  &quot;$vdiskid&quot; != *&quot;.iso&quot; ]
then
if [ &quot;$imgshareable&quot; = &quot;Yes&quot;  ]
then
for item in `printf &quot;%s\n&quot; &quot;${imginfo[@]}&quot; | grep Vm | cut -d : -f 2 | sed 's/\[\|\]//g'`
do
shareddiskvmnames+=&quot;$item&quot;_
done
newvdiskname=&quot;${shareddiskvmnames}${slotname}&quot;
unset shareddiskvmnames
fi
if [ &quot;$vdiskname&quot; != &quot;$newvdiskname&quot; ]
then
if [ &quot;$verbose&quot; = &quot;1&quot; ]
then
echo &quot;  Disk Name       :  $vdiskname&quot;
echo &quot;  New Disk Name   :  $newvdiskname&quot;
fi
echo &quot;Renaming [ $vdiskname ] to follow Standard [ $newvdiskname ]  &quot;
if [ &quot;$dryrun&quot; = &quot;1&quot; ]
then
echo &quot;&quot;
else
ssh -p $ovmport $ovmuser@$ovmmgr &quot;edit virtualdisk id=$vdiskid name=$newvdiskname&quot; | grep &quot;Status:&quot;
fi
echo &quot;&quot;
else
echo &quot;Name [ $vdiskname ] follows Standard [ $newvdiskname ]&quot;
echo &quot;&quot;
fi
else
echo &quot;Virtual CDROM Detected.  Rename not Required.&quot;
echo &quot;&quot;
fi
done</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/02/ovmcli-standardize-the-naming-of-virtual-disks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OVMCLI: Standardize the Case of VM Names</title>
		<link>http://blog.allanglesit.com/2013/02/ovmcli-standardize-the-case-of-vm-names/</link>
		<comments>http://blog.allanglesit.com/2013/02/ovmcli-standardize-the-case-of-vm-names/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 12:00:30 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Oracle VM]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[has-code]]></category>
		<category><![CDATA[oracle vm]]></category>
		<category><![CDATA[oracle vm 3]]></category>
		<category><![CDATA[ovm]]></category>
		<category><![CDATA[ovm3]]></category>
		<category><![CDATA[ovmcli]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1449</guid>
		<description><![CDATA[So I have been working with the OVM CLI lately to try and fill in some holes in my knowledge and provide for some easily reproducible procedures, usually around consistency of the environment when performing frequent tear downs and upgrades.  So expect to see more OVM related scripts going forward. Today we are going over [...]]]></description>
				<content:encoded><![CDATA[<p>So I have been working with the OVM CLI lately to try and fill in some holes in my knowledge and provide for some easily reproducible procedures, usually around consistency of the environment when performing frequent tear downs and upgrades.  So expect to see more OVM related scripts going forward.</p>
<p>Today we are going over a fairly simple script.  I like to use all lower case in my VM naming conventions.  So I wrote up a little script to check every name in the environment and then rename it if it is not already lower case.  Then once I completed this I decided to change it to be a toggle, so that those of you who prefer upper case would not feel left out.  Basically what we are doing, is simply performing a few calls to the ovmcli to collect the information necessary to make our changes.  Then we perform the changes via a separate call.  Prior to making the edit call, we compare the actual value with the requested value in order to see if it is already what we wanted.</p>
<p>I have built a few parameters into the script, we can select the case, upper or lower, we can also select the OVM 3.x Manager Server, and the username and port.  The username and port are built with default values of admin and 10000.</p>
<p>Please keep in mind that this script will make multiple SSH connections to the ovmcli, as such you will want to use keys to streamline this authentication.  I have an article covering that <a title="Oracle VM 3: Enable Key Based Authentication to OVM CLI" href="http://blog.allanglesit.com/2013/01/oracle-vm-3-enable-key-based-authentication-to-ovm-cli/">here</a>.</p>
<p>Name       : changecase-vmname.sh<br />
Version   :  1.0.1<br />
MD5        :  5006c9ff20b3301e66ac503f417b98ee<br />
SHA256  :  bfff98b74c54f1fec3ec540a22ca4b1377c9f4b25e0b90ddbb722eeb64bf6bc8<br />
URL         :  <a href="http://source.allanglesit.net/pub/changecase-vmname.sh">http://source.allanglesit.net/pub/changecase-vmname.sh</a></p>
<pre class="brush: bash; collapse: true; first-line: 1; gutter: true; light: false; title: Expand changecase-vmname.sh; toolbar: true; notranslate">#!/bin/bash
# chkconfig:
# description:
#
#: Script Name    : changecase-vmname.sh
#: Version    : 1.0
#: Author    : Matthew Mattoon - http://blog.allanglesit.com
#: Date Created    : January 26, 2013
#: Date Updated    : February 20, 2013
#: Description    : Changes case of all Oracle VM 3.x VMs to either upper or lower case.
#: Examples    : changecase-vmname.sh -c CASE -m OVMMANAGER -p PORT -u USER
#:         : changecase-vmname.sh -c lower -m ovmserver.localdomain

usage()
{
cat &lt;&lt; EOF
usage: $0 options

This script allows you to change case on all OVM 3.x VMs to either uppercase or lowercase.

OPTIONS:
-h    Show this message
-c    The preferred case for all VMs (required). upper or lower
-m    OVM 3.x Manager Server (required).
-p    OVM 3.x Manager Port (default: 10000).
-u    OVM 3.x Manager User (default: admin).
EOF
}

while getopts &quot;hc:m:pu&quot; OPTION
do
case $OPTION in
h) usage; exit 1;;
c) case=$OPTARG;;
m) ovmmgr=$OPTARG;;
p) ovmport=$OPTARG;;
u) ovmuser=$OPTARG;;
?) usage; exit 1;;
esac
done

if [[ -z $case ]] || [[ -z $ovmmgr ]]
then
usage
exit 1
fi

if [ $case != &quot;lower&quot; -a $case != &quot;l&quot; -a $case != &quot;upper&quot; -a $case != &quot;u&quot; ]
then
usage
exit 1
fi

if [[ -z $ovmuser ]]
then
ovmuser=admin
fi

if [[ -z $ovmport ]]
then
ovmport=10000
fi

if [ $case = &quot;lower&quot; -o $case = &quot;l&quot; ]
then
trcase=&quot;'[:upper:]' '[:lower:]'&quot;
fi

if [ $case = &quot;upper&quot; -o $case = &quot;u&quot; ]
then
trcase=&quot;'[:lower:]' '[:upper:]'&quot;
fi

for i in `ssh -p $ovmport $ovmuser@$ovmmgr &quot;list vm&quot; | grep -v 'OVM&gt;\|Command:\|Status:\|Time:\|Data:' | sed 's/  /:/g'`
do
id=`echo $i | cut -d &quot;:&quot; -f 3`
echo -n &quot;Examining $id...  &quot;
vmname=`ssh -p $ovmport $ovmuser@$ovmmgr &quot;show vm id=$id&quot; | grep -v 'OVM&gt;\|Command:\|Status:\|Time:\|Data:' | grep &quot;Name&quot; | sed 's/ = /=/' | cut -d = -f 2`
newvmname=`echo $vmname | tr $trcase`
if [ $vmname != $newvmname ]
then
echo &quot;Renaming $vmname to $newvmname&quot;
ssh -p $ovmport $ovmuser@$ovmmgr edit vm id=$id name=&quot;$newvmname&quot; | grep &quot;Status:&quot;
else
echo &quot;Rename not required&quot;
fi
done</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/02/ovmcli-standardize-the-case-of-vm-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sudo: Setting Up Intelligent Security Policies Part Two</title>
		<link>http://blog.allanglesit.com/2013/01/sudo-setting-up-intelligent-security-policies-part-two/</link>
		<comments>http://blog.allanglesit.com/2013/01/sudo-setting-up-intelligent-security-policies-part-two/#comments</comments>
		<pubDate>Thu, 31 Jan 2013 12:00:03 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[General Information]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[/etc/sudoers]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[enable sudo]]></category>
		<category><![CDATA[howto sudo]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[privilege escalation]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[su]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[sudo benefits]]></category>
		<category><![CDATA[sudo policy]]></category>
		<category><![CDATA[visudo]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1359</guid>
		<description><![CDATA[In Part One we went over the basics of sudo, what it is, why we use it, and how it is used properly.  In this article we are going to take it a step further and look at specific use cases for sudo.  The key thing to remember though, is that you have two ways [...]]]></description>
				<content:encoded><![CDATA[<p>In Part One we went over the basics of sudo, what it is, why we use it, and how it is used properly.  In this article we are going to take it a step further and look at specific use cases for sudo.  The key thing to remember though, is that you have two ways you can use sudo, 1) to allow for program execution as root, a white-list  2) to restrict program execution as root, a black-list.  If you are doing the later there is no definitive way to restrict a program execution, so you should only use the latter with administrators who are trusted completely (the same users who would have access to the root password).</p>
<p><strong>Allow A Specific Command Execution as Root (The Real Sudo)<br />
</strong></p>
<p>This first policy example is what sudo is for.  This is where you want individuals to perform a specific action as root (for example restart a service which is known to be flaky instead of calling you at 2AM).  These commands can be specific down to parameters and everything.  Of course once the sudo policy is in place you could even go a step further and create aliases in their user profile so that they can execute simpler commands.  For example &#8220;/etc/init.d/network restart&#8221; can be aliased to &#8220;internet-reboot&#8221; or something equally simple/ridiculous.</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/sudoers
# Specific Command Execution
Defaults logfile=/var/log/sudo.log
User_Alias ROOTCOMMAND = user1, user2
Cmnd_Alias REBOOT = /sbin/reboot
Cmnd_Alias SERVICE = /etc/init.d/network restart
ROOTCOMMAND ALL=NOPASSWD: REBOOT, SERVICE</pre>
<p>One other small thing I did in this example.  Since this has a VERY restrictive policy and we are only allowing to possible commands to be run I have removed the password requirement. I do not allow this on a wider policy.  This comes back to the saying:</p>
<p>Quick, Easy, Secure &#8211; pick two.</p>
<p><strong>Allow Root Access with Some Disallowances<br />
</strong></p>
<p>This policy is a much safer policy for individuals who are not fully trusted, for example Junior Sys Admins.  This policy closes most of the holes which would allow them to inadvertently or intentionally lock out other individuals from the machine, the key difference between this and the above policy is that it requires all commands be executed via sudo, instead of being able to spawn a shell as root, and bypass the logging.</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/sudoers
# Root with Restrictions
Defaults logfile=/var/log/sudo.log
User_Alias ROOTRESTRICTED = user1, user2
Cmnd_Alias SHELLS = /bin/sh, /bin/bash, /bin/ash, /bin/bsh, /bin/tcsh, /bin/csh, /bin/ksh, /bin/ksh93
Cmnd_Alias SU = /bin/su, /usr/bin/vncserver
Cmnd_Alias PASSWD = /bin/passwd, /usr/sbin/useradd, /usr/sbin/userdel, /usr/sbin/usermod
Cmnd_Alias VISUDO = /usr/sbin/visudo
ROOTRESTRICTED ALL = ALL, !SHELLS, !SU, !PASSWD, !VISUDO</pre>
<p><strong>Allow Unrestricted Root Access</strong></p>
<p>This is the basics of a policy that I use on my workstations.  This also fits very well on servers where you have a requirement to not login to the root account except in an emergency.</p>
<p>This policy has NO restrictions on it.  As such the only people whom you will want to grant this policy to are the same folks you would provide your root password to.  This policy also allows the direct invocation of a shell as root, which gives you a root shell, which after that nothing is logged in the sudo.log.</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/sudoers
# Root Equivalent
Defaults logfile=/var/log/sudo.log
User_Alias ROOTEQUIVALENT = user1, user2
ROOTRESTRICTED ALL = ALL</pre>
<p><strong>Switch Users Using Sudo</strong></p>
<p>Here is another little tidbit I like to use on systems which require multiple system accounts to run multiple applications.  Instead of having to track and know each user and password combination (or having someone else have to do the same) I like to enable users to use sudo to invoke su to switch to the specific user.  This of course means that they will not be prompted to enter a password for the user that they are logging into but they will be logging that entry into sudo.</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/sudoers
# Switch User Without Additional Password Management
Defaults logfile=/var/log/sudo.log
User_Alias TSTEBSUSER = bob, bill
Cmnd_Alias SUTSTEBS = /bin/su tstebs, /bin/su - tstebs
TSTEBSUSER ALL = SUTSTEBS
User_Alias TSTWLSUSER = bob, mark, jon
Cmnd_Alias SUTSTWLS = /bin/su tstebs, /bin/su - tstebs
TSTWLSUSER ALL = SUTSTWLS</pre>
<p>Above we can see that we have two environments to be managed our TSTWLS and our TSTEBS environment.  Each of these environments is executed and managed using the tstwls and tstebs users respectively.  We can also see that according to the policy we have a user named bob with access to both environments.  The TSTEBS environment also has a user named bill who has access to the environment.  While on TSTWLS we additionally have mark, and jon who have access to the environment.</p>
<p>These are the most common use cases I have run into for using sudo.  There are many more policy restrictions (noexec &#8211; disallow the execution of scripts) which are detailed in the man pages for sudo.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/01/sudo-setting-up-intelligent-security-policies-part-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sudo: Setting Up Intelligent Security Policies Part One</title>
		<link>http://blog.allanglesit.com/2013/01/sudo-setting-up-intelligent-security-policies-part-one/</link>
		<comments>http://blog.allanglesit.com/2013/01/sudo-setting-up-intelligent-security-policies-part-one/#comments</comments>
		<pubDate>Wed, 30 Jan 2013 12:00:20 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[General Information]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[/etc/sudoers]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[enable sudo]]></category>
		<category><![CDATA[howto sudo]]></category>
		<category><![CDATA[policy. security]]></category>
		<category><![CDATA[privilege escalation]]></category>
		<category><![CDATA[su]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[sudo benefits]]></category>
		<category><![CDATA[sudo policy]]></category>
		<category><![CDATA[visudo]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1439</guid>
		<description><![CDATA[What is Sudo? Prior to sudo whenever you wanted to run a command as a specific user then you would su (switch user) to gain access to a shell for that user.  This of course required that you knew the password for that user, and it would spawn a new shell after successful authentication.  The [...]]]></description>
				<content:encoded><![CDATA[<p><strong>What is Sudo?</strong></p>
<p>Prior to sudo whenever you wanted to run a command as a specific user then you would su (switch user) to gain access to a shell for that user.  This of course required that you knew the password for that user, and it would spawn a new shell after successful authentication.  The major drawback to this was that in order to allow a user to do something, you had to allow the user to do anything.  This sort of configuration also makes it fairly trivial for an authorized user to perform unauthorized actions, such as changing the root password and locking everyone out.</p>
<p>Basically sudo is a setuid binary which allows any user to invoke it as root.  Here is where it starts to get a bit tricky.  Any user can invoke sudo as root.  However that doesn&#8217;t mean that any user can invoke anything with sudo as root.  Sudo itself is invoked as root, and then the policy processing begins and sudo determines if it is going to do what you are requesting (if it is in policy).</p>
<p><strong>Remember Su-Do</strong></p>
<p>If you remember nothing else about sudo (as a user) then remember this.  Sudo allows you to &#8220;su and do&#8221; without having to &#8220;su and do&#8221;.  This of course means that the below actions are identical in terms of executing the action.</p>
<pre class="brush: plain; title: ; notranslate">$ su -
Password:
# whoami
root</pre>
<pre class="brush: plain; title: ; notranslate">$ sudo whoami
[sudo] password for oracle:
root</pre>
<p>The only real difference in the above is the password that we enter.  In the first example we need to enter the root password.  In the second we enter the password of the user we are logged in as.</p>
<p><strong>Sudo Usage</strong></p>
<p>A great example to illustrate the functionality of sudo is the simple &#8220;id&#8221; this command simply lists your security contexts.  When we execute id</p>
<pre class="brush: plain; title: ; notranslate">$ id
uid=1000(matthew) gid=1000(matthew) groups=1000(matthew),10(wheel),18(dialout),1001(vboxusers)</pre>
<p>Above we can see that we are logged in with the user matthew with the uid of 1000.  You also see the groups that I am a member of.</p>
<pre class="brush: plain; title: ; notranslate">$ sudo id
[sudo] password for matthew:
uid=0(root) gid=0(root) groups=0(root)</pre>
<p>Now when we insert sudo in front of the id command we notice that it prompts for a password, specifically the password of the user invoking sudo (in this case matthew).  After successful authentication then we see that we actually get the id information for the root user.</p>
<p>There is another major way that sudo can be used.  And that is to achieve a root shell.</p>
<pre class="brush: plain; title: ; notranslate">$ sudo -s
[sudo] password for matthew:
#</pre>
<p>Above we see that we now have a persistent root shell.  The big takeaway from this usage is that you lose all of your sudo logging.  The only thing that is logged is the execution of the shell (this will be the users shell defined in the /etc/passwd &#8211; usually /bin/bash).</p>
<pre class="brush: plain; title: ; notranslate"># more /var/log/sudo.log
Jan 22 16:04:09 : matthew : TTY=pts/8 ; PWD=/home/matthew ; USER=root ;
COMMAND=/bin/bash</pre>
<p><strong>Sudo Logging</strong></p>
<p>One of the biggest benefits of sudo is the ability to log what individuals are doing on a system, and thus having the ability to forensically resolve problems based on the actions that were taken just prior to the problem.  Here is an example of what the output looks like.</p>
<pre class="brush: plain; title: ; notranslate"># more /var/log/sudo.log
Jan 22 13:25:13 : user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ;
COMMAND=/etc/init.d/network restart
Jan 22 13:25:34 : user1 : command not allowed ; TTY=pts/0 ; PWD=/home/user1 ;
USER=root ; COMMAND=/etc/init.d/network status</pre>
<p>Now we can see that we have a successful execution of /etc/init.d/network restart on line 1.  This took place at Jan 22 13:25:13 local time.  We also know that it was invoked by the oracle user, while the oracle user was standing in /home/oracle (this is important for anything executed using a relative path).  We also then see the user that the command is executed as (which in this case is root).</p>
<p>The second entry we have is an attempt by the oracle user to execute /etc/init.d/network status.  This was denied because it is outside the allowance of the sudo policy.</p>
<p><strong>List Effective Sudo Policy</strong></p>
<p>You won&#8217;t always be in an environment where you will be able to push for changes to your sudo policies, however it doesn&#8217;t mean that you can&#8217;t look at the effective ruleset to see what you have in effect.  To list the policies as they are in effect against your user.</p>
<pre class="brush: plain; title: ; notranslate">$ sudo -l
Matching Defaults entries for matthew on this host:
requiretty, env_reset, env_keep=&quot;COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR
LS_COLORS&quot;, env_keep+=&quot;MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE&quot;,
env_keep+=&quot;LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES&quot;,
env_keep+=&quot;LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE&quot;, env_keep+=&quot;LC_TIME
LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY&quot;,
secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin, logfile=/var/log/sudo.log

User matthew may run the following commands on this host:
(ALL) ALL</pre>
<p>If you are building policies and you want to test the effective policies for a specific user.  You can invoke it like so to list the effective policy.</p>
<pre class="brush: plain; title: ; notranslate"># sudo -U matthew -l
Matching Defaults entries for matthew on this host:
requiretty, !visiblepw, env_reset, env_keep=&quot;COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC
KDEDIR LS_COLORS MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE LC_COLLATE
LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER
LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY&quot;,
logfile=/var/log/sudo.log

Runas and Command-specific defaults for matthew:

User matthew may run the following commands on this host:
(root) ALL, (root) !/bin/sh, !/bin/bash, !/bin/bash2, !/bin/ash, !/bin/bsh,
!/bin/tcsh, !/bin/csh, !/bin/ksh, !/bin/ksh93, (root) !/bin/su, !/usr/bin/vncserver,
(root) !/bin/passwd, !/usr/sbin/useradd, !/usr/sbin/userdel, !/usr/sbin/usermod,
(root) !/usr/sbin/visudo</pre>
<p>That wraps up Part One.  In Part Two we will look at specific policy examples and how they would be used.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/01/sudo-setting-up-intelligent-security-policies-part-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle VM 3: Enable Key Based Authentication to OVM CLI</title>
		<link>http://blog.allanglesit.com/2013/01/oracle-vm-3-enable-key-based-authentication-to-ovm-cli/</link>
		<comments>http://blog.allanglesit.com/2013/01/oracle-vm-3-enable-key-based-authentication-to-ovm-cli/#comments</comments>
		<pubDate>Tue, 29 Jan 2013 12:00:38 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Oracle VM]]></category>
		<category><![CDATA[authorized_keys]]></category>
		<category><![CDATA[ovm]]></category>
		<category><![CDATA[ovm 3]]></category>
		<category><![CDATA[ovmcli]]></category>
		<category><![CDATA[publickey]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1424</guid>
		<description><![CDATA[I have been spending some time learning the OVM 3 CLI since it was released in the earlier 3.x versions, however the biggest roadblock for me has always been that they only allow access via SSH on port 10000.  However now I know how to enable key based authentication for these connections opening this up [...]]]></description>
				<content:encoded><![CDATA[<p>I have been spending some time learning the OVM 3 CLI since it was released in the earlier 3.x versions, however the biggest roadblock for me has always been that they only allow access via SSH on port 10000.  However now I know how to enable key based authentication for these connections opening this up for a much more robust scripting experience.</p>
<p><strong>Connect to OVM CLI with Password</strong></p>
<pre class="brush: plain; title: ; notranslate">$ ssh -p 10000 admin@ovmmgr.allanglesit.com
admin@ovmmgr.allanglesit.com's password:
OVM&gt;</pre>
<p><strong>Authorize Keys for OVM CLI</strong></p>
<p>To allow key based authentication to OVM CLI simply add your public key on your OVM Manager Server to /home/oracle/.ssh/ovmcli_authorized_keys.  For our environment we already had everyone who needed access in the authorized_keys for root.</p>
<pre class="brush: plain; title: ; notranslate"># cat /root/.ssh/authorized_keys &gt;&gt; /home/oracle/.ssh/ovmcli_authorized_keys</pre>
<p>However if you wanted to do it remotely using the public key file directly from your client.</p>
<pre class="brush: plain; title: ; notranslate"># cat .ssh/id_rsa.pub | ssh root@ovmmgr.allanglesit.com &quot;cat &gt;&gt; /home/oracle/.ssh/ovmcli_authorized_keys&quot;</pre>
<p><strong>Connect to OVM CLI with Public Keys</strong></p>
<p>Now our connection is without that pesky password prompt.</p>
<pre class="brush: plain; title: ; notranslate">$ ssh -p 10000 admin@ovmmgr.allanglesit.com
OVM&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/01/oracle-vm-3-enable-key-based-authentication-to-ovm-cli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle VM 3: Orphaned VMs</title>
		<link>http://blog.allanglesit.com/2013/01/oracle-vm-3-orphaned-vms/</link>
		<comments>http://blog.allanglesit.com/2013/01/oracle-vm-3-orphaned-vms/#comments</comments>
		<pubDate>Mon, 28 Jan 2013 12:00:47 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Oracle VM]]></category>
		<category><![CDATA[oracle vm]]></category>
		<category><![CDATA[oracle vm 3]]></category>
		<category><![CDATA[orphaned vms]]></category>
		<category><![CDATA[ovm]]></category>
		<category><![CDATA[ovm 3.2.1]]></category>
		<category><![CDATA[ovm3]]></category>
		<category><![CDATA[rediscover hypervisor]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1403</guid>
		<description><![CDATA[One of my biggest complaints about Oracle VM 3 is that everything is abstracted at every level.  A VM name is simply meta data stored in a database (kind of) while everywhere that it matters the VM only exists as a UUID, lets look at some examples. The Way It Is From the hypervisor if [...]]]></description>
				<content:encoded><![CDATA[<p>One of my biggest complaints about Oracle VM 3 is that everything is abstracted at every level.  A VM name is simply meta data stored in a database (kind of) while everywhere that it matters the VM only exists as a UUID, lets look at some examples.</p>
<p><strong>The Way It Is</strong></p>
<p>From the hypervisor if we use native Xen commands to look at all of the instantiated VMs.</p>
<pre class="brush: plain; title: ; notranslate"># xm list
Name                                        ID   Mem VCPUs      State   Time(s)
0004fb000006000002a00feb1f52cae4           155  8192     2     -b----  39176.1
0004fb00000600000b5b1f8673c451be           171  8192     2     -b---- 1007276.5
0004fb000006000026a40b6fb53fe2c3           135 16384     2     -b---- 169716.7
0004fb0000060000506f591d6877c284           194  3072     1     -b----  16108.4
0004fb00000600007052ad7b040749ea           176  8192     2     -b---- 1726118.2
0004fb0000060000a07b66923b0f68a4           138  4096     2     -b---- 2092394.0
0004fb0000060000abfcf710ebd640df           101  2048     2     -b---- 540488.4
0004fb0000060000bf16256b99159fc6           143 16384     2     -b---- 3972112.7
0004fb0000060000e3f234f6c1d26448           173  8192     2     -b---- 852019.6
0004fb0000060000e602b0e0969dba07            92  2048     2     -b---- 234244.0
0004fb0000060000f9205e11159e5459           175 12288     2     r----- 4145289.3
Domain-0                                     0  2486    24     r----- 4455022.6</pre>
<p>Now since under the covers we are using Xen that means that somewhere there is a vm.cfg file (could be named anything, but for now they are sticking with vm.cfg).</p>
<pre class="brush: plain; title: ; notranslate"># cat vm.cfg
vif = ['mac=00:21:f6:00:00:07,bridge=172.16.88.0']
OVM_simple_name = 'PRD-IM'
guest_os_type = 'linux'
disk = ['file:/OVS/Repositories/0004fb00000300005527ce584481a013/VirtualDisks/0004fb000012000052e7181e3458aba7.img,xvda,w']
vncunused = '1'
uuid = '0004fb00-0006-0000-506f-591d6877c284'
on_reboot = 'restart'
boot = 'cn'
cpu_weight = 27500
memory = 3072
cpu_cap = 0
maxvcpus = 2
OVM_high_availability = False
vnclisten = '127.0.0.1'
vnc = '1'
OVM_description = 'Keste IM - Prod'
on_poweroff = 'destroy'
on_crash = 'restart'
maxmem = 3072
name = '0004fb0000060000506f591d6877c284'
builder = 'hvm'
vcpus = 1
keymap = 'en-us'
OVM_os_type = 'Oracle Linux 6'
OVM_cpu_compat_group = ''
OVM_domain_type = 'xen_hvm'</pre>
<p>But finding it can be tricky.  All repositories are stored in UUID form under /OVS/Respositories.  Then inside of each repo you have multiple folders, Assemblies, ISOs, Templates, VirtualDisks, VirtualMachines.  They are pretty self explanatory, but vm.cfgs go under VirtualMachines, they then refer to virtual disk images in the VirtualDisks folders.  Here is an example for the vm.cfg we looked at above.</p>
<pre class="brush: plain; title: ; notranslate"># pwd
/OVS/Repositories/0004fb00000300005527ce584481a013/VirtualMachines/0004fb0000060000506f591d6877c284</pre>
<p>This breaks down like this&#8230;</p>
<p>/OVS/Repositories/ [UUID of REPO] /VirtualMachines/ [UUID of VM] /vm.cfg</p>
<p><strong>The Problem</strong></p>
<p>If we lose the manager, then we lose all ability to manage the environment without heavy navigation of the file system, or if we discover a hypervisor which was previously managed by the same OVM Manager UUID then we end up with a bunch of Orphaned VMs.  You will notice that not only is there no meaningful names, there is also no meaningful information about the VMs, I assure that not all of my VMs have 256MB of RAM with a single CPU.</p>
<p><img class="aligncenter size-medium wp-image-1405" alt="ovm3-orphaned-vms-001" src="http://blog.allanglesit.com/wp-content/uploads/2013/01/ovm3-orphaned-vms-001-300x48.png" width="300" height="48" /></p>
<p style="text-align: center">Figure 1-1: Orphaned VMs</p>
<p><strong>The Solution</strong></p>
<p>Now the crux of this problem is that while we have discovered the Hypervisor we have not discovered the underlying repository.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-medium wp-image-1406" alt="ovm3-orphaned-vms-002" src="http://blog.allanglesit.com/wp-content/uploads/2013/01/ovm3-orphaned-vms-002.png" width="275" height="62" /></p>
<p style="text-align: center">Figure 1-2: Our Server Pool and Hypervisor</p>
<p style="text-align: left">So first thing we need to do is right-click on the hypervisor and &#8220;Rescan Physical Disks&#8221; this should complete fairly quickly.  This will allow OVM Manager to be aware of the Physical Disk on which we have our repository with our running VMs.  Disregard the warning icon, that is due to having an older version of the hypervisor on that machine (3.1.1)</p>
<p><img class="aligncenter size-medium wp-image-1407" alt="ovm3-orphaned-vms-003" src="http://blog.allanglesit.com/wp-content/uploads/2013/01/ovm3-orphaned-vms-003-300x31.png" width="300" height="31" /></p>
<p style="text-align: center">Figure 1-3: Rescan Physical Disks Job</p>
<p style="text-align: left">Here we simply monitor the job until completion.  After it is complete we right-click on the hypervisor and &#8220;Rediscover Server&#8221; this allows the OVM Manager to look at the physical disk that it just found out about to see if there is a repository on it.</p>
<p><img class="aligncenter size-medium wp-image-1408" alt="ovm3-orphaned-vms-004" src="http://blog.allanglesit.com/wp-content/uploads/2013/01/ovm3-orphaned-vms-004-300x31.png" width="300" height="31" /></p>
<p style="text-align: center">Figure 1-4: Rediscover Server Job</p>
<p style="text-align: left">Monitor until the job completes.</p>
<p style="text-align: center"><img class="aligncenter size-medium wp-image-1410" alt="ovm3-orphaned-vms-006" src="http://blog.allanglesit.com/wp-content/uploads/2013/01/ovm3-orphaned-vms-006-300x231.png" width="300" height="231" /></p>
<p style="text-align: center">Figure 1-5: New Repository Visible</p>
<p style="text-align: left">Now we see a UUID for a new repository under the Repositories tab.  Right-click and Refresh.</p>
<p style="text-align: left"><img class="aligncenter size-medium wp-image-1411" alt="ovm3-orphaned-vms-007" src="http://blog.allanglesit.com/wp-content/uploads/2013/01/ovm3-orphaned-vms-007-300x34.png" width="300" height="34" /></p>
<p style="text-align: center">Figure 1-6: Repository Refresh Job</p>
<p style="text-align: left">Monitor until the job completes.</p>
<p style="text-align: left"><img class="aligncenter size-medium wp-image-1412" alt="ovm3-orphaned-vms-008" src="http://blog.allanglesit.com/wp-content/uploads/2013/01/ovm3-orphaned-vms-008-300x70.png" width="300" height="70" /></p>
<p style="text-align: center">Figure 1-7: Fixed VMs</p>
<p style="text-align: left">Now our VMs show the correct information.</p>
<p style="text-align: left"><strong>A Few Notes</strong></p>
<p style="text-align: left">Any names that you assigned VirtualDisks are gone, they are back to UUID, sorry.  Also if you had any machines that are stopped when you perform this action you will not see them on the hypervisor.  They are in the Unassigned Virtual Machines folder.  Click and drag to re-assign them.  Or use the Migrate button.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/01/oracle-vm-3-orphaned-vms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shore Up New Jersey: Hurricane Sandy Relief Efforts</title>
		<link>http://blog.allanglesit.com/2013/01/shore-up-new-jersey-hurricane-sandy-relief-efforts/</link>
		<comments>http://blog.allanglesit.com/2013/01/shore-up-new-jersey-hurricane-sandy-relief-efforts/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 18:13:29 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Completely Non-Technical]]></category>
		<category><![CDATA[General Information]]></category>
		<category><![CDATA[al]]></category>
		<category><![CDATA[charity]]></category>
		<category><![CDATA[hddr]]></category>
		<category><![CDATA[new jersey]]></category>
		<category><![CDATA[people helping people]]></category>
		<category><![CDATA[relief work]]></category>
		<category><![CDATA[shore up]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1363</guid>
		<description><![CDATA[I wanted to take a few minutes and let all of you know about an organization I had the pleasure and honor of working with recently.  I have worked with similar organizations previously however there was something truly special about this organization.  This organization was Heavenly Driven Disaster Relief website here. About HDDR Basically HDDR [...]]]></description>
				<content:encoded><![CDATA[<p>I wanted to take a few minutes and let all of you know about an organization I had the pleasure and honor of working with recently.  I have worked with similar organizations previously however there was something truly special about this organization.  This organization was Heavenly Driven Disaster Relief website <a href="http://hddrelief.com" target="_blank">here</a>.</p>
<p><strong>About HDDR</strong></p>
<p>Basically HDDR is a non-profit organization which want to help people afflicted by disasters, they have been all over the world working in disaster areas trying to help people clean up and rebuild their lives.  At the center of this ministry is Albert Knight, he is a contractor with a passion for helping people.  He coordinates volunteer teams of all skill levels to complete the work that is being done under the organization.  While HDDR is a Christian Organization they do not require volunteers have an affiliation with a specific church or even religion.  People of all faiths and lifestyles are encouraged to get involved.  Another thing that HDDR does differently is they really try to defray some of the costs of your participation in the relief efforts.  They are able to provide housing and food for groups, leaving you with only the costs associated with getting there.</p>
<p><strong>About Al</strong></p>
<p>We came to work, and to be honest Al didn&#8217;t expect alot from us, all he really wanted was 8AM &#8211; 4PM so he was surprised when our crew went back out after dinner (most nights) to finish up some jobs.  But the really important thing for you to understand about Al, is that he really burns for this ministry.  While this is in his backyard.  This is by no means without sacrifice for him.  Al has a home in Philadelphia, PA but during the week he is living with the volunteers in Atlantic City, NJ so that they can get an early start.</p>
<p><strong>Lessons Learned</strong></p>
<p>Al runs a really tight ship.  We lead a team of 9 to New Jersey from Dallas, TX.  This was a 25-27 hour drive.  We had two pickups one of which was packed to the gills with tools and gear.  Looking back we brought too much.  Al already had most everything that was needed.  That said I would recommend that everyone who plans on going forget all of the tools that they think they will need (Al has all of those) and instead focus on having a basic toolkit for each member of your team.</p>
<ul>
<li>Tool Belt / Leathers</li>
<li>Hammer</li>
<li>Tape Measure</li>
<li>Carpenters Pencils (at least 3)</li>
<li>Utility Knife or Break-Away Razor</li>
<li>1 each Phillips and Standard Screwdriver</li>
<li>Work Boots (steel toe)</li>
</ul>
<p>Now had we packed the above we would have needed one storage box which could have held all of these, instead of half of a pick-up bed.  And honestly the only other things that we used were things that Al already had (skil saw, nail gun, miter saw) but we used ours because the pickup was 10 feet closer than the trailer.</p>
<p><strong>How Can I Help?</strong></p>
<p>Oh here it comes, the part where he tries to pry money out of my wallet&#8230;  Honestly though, HDDR and Al don&#8217;t want your money.  But they do need your skilled or unskilled labor.  They really can work with all skill levels, and they will put you to work at a level where you feel comfortable and challenged, so you won&#8217;t just be picking up garbage.  He takes the time to show you what to do, and then he lets you run and do it.  Now all that said if you are not able to give of your time but you&#8217;d like to give of your resources instead they will be more than happy to receive that donation and will make sure that it is maximized.  You have a couple of options&#8230;</p>
<ol>
<li>Buy a shirt or sweater on the HDDR <a title="HDDR Contact" href="http://hddrelief.com/hddr/contact" target="_blank">website</a></li>
<li>Make a cash donation, or a donation of specific supplies and gift cards</li>
<li>HDDR is working on getting PayPal set up so that they can streamline the donation process, in the interim if you&#8217;d like to make a donation to them through my site using the link <strong>on the bottom of this post</strong> please feel free to do so.  Note: if you choose to do so please understand that I will forward the money to HDDR as quickly as possible (I would guess they should be able to have it inside of a week and a half based on clearing times) and I encourage you to coordinate with HDDR to ensure that the money is received (and that you get all appropriate tax receipts).</li>
</ol>
<!-- Begin PayPal Donations by http://johansteen.se/ -->
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <div class="paypal-donations">
        <input type="hidden" name="cmd" value="_donations" />
        <input type="hidden" name="business" value="matthew.mattoon@allanglesit.com" />
<input type="hidden" name="return" value="http://blog.allanglesit.com/donations/thanks-for-your-donation/" /><input type="hidden" name="item_name" value="Heavenly Driven Disaster Relief" /><input type="hidden" name="item_number" value="IT From All Angles Article" /><input type="hidden" name="currency_code" value="USD" /><input type="image" src="http://blog.allanglesit.com/wp-content/uploads/2011/03/button_donate_blue-e1300407631666.png" name="submit" alt="PayPal - The safer, easier way to pay online." /><img alt="" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />    </div>
</form>
<!-- End PayPal Donations -->

<p><strong>The Videos</strong></p>
<p>We had some guys with us who are creative geniuses who were able to capture quite a bit of great footage and edit it together into daily videos.</p>
<p><iframe src="http://player.vimeo.com/video/57601574" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p><iframe src="http://player.vimeo.com/video/57616321" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p><iframe src="http://player.vimeo.com/video/57964755" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/01/shore-up-new-jersey-hurricane-sandy-relief-efforts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7: The Never Ending Printer</title>
		<link>http://blog.allanglesit.com/2013/01/windows-7-the-never-ending-printer/</link>
		<comments>http://blog.allanglesit.com/2013/01/windows-7-the-never-ending-printer/#comments</comments>
		<pubDate>Wed, 16 Jan 2013 12:00:13 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[laserjet 1022n]]></category>
		<category><![CDATA[printing]]></category>
		<category><![CDATA[spooler]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1340</guid>
		<description><![CDATA[The past couple of weeks I have been dealing with a fairly aggravating issue at home.  My wife has a Windows 7 laptop which for some reason started printing everything repeatedly (repeatedly being defined as forever and ever until the bottom of the paper tray was found).  Our printer in particular is a HP Laserjet [...]]]></description>
				<content:encoded><![CDATA[<p>The past couple of weeks I have been dealing with a fairly aggravating issue at home.  My wife has a Windows 7 laptop which for some reason started printing everything repeatedly (repeatedly being defined as forever and ever until the bottom of the paper tray was found).  Our printer in particular is a HP Laserjet 1022n which is connected to the network, and my wife&#8217;s computer connects via the network directly (as in not using any print server to mediate the jobs).  When this was occurring and looking at the print queue I was seeing the one job, however the job kept flashing (or perhaps blinking) and it seemed like the job was being continuously restarted.  This would even happen for test pages.  The only other machines in the house are Linux/Unix and none of them had the same issue so it didn&#8217;t appear to be caused by the printer itself.  One other detail was that I purchased this printer new in 2005 and it has been working just fine since then, with this computer and others.</p>
<p><strong>Things I Tried</strong></p>
<ul>
<li>Updating the Windows 7 Print Driver</li>
<li>Updating the Printers Firmware</li>
<li>Deleting the Printer and Recreating it in Window</li>
</ul>
<p>None of the above &#8220;fixed&#8221; the problem.  However I was able to find a solution.  The problem apparently was Bi-Directional Support.</p>
<ol>
<li>Click on Start</li>
<li>Select Devices and Printers</li>
<li>Right Click on the Symptomatic Printer</li>
<li>Select Printer Properties</li>
<li>Click on the Ports Tab</li>
<li>Uncheck Enable Bidirectional Support</li>
<li>Click Apply and Re-Test</li>
</ol>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/01/windows-7-the-never-ending-printer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris 11: Using Crashplan for Cloud Backups</title>
		<link>http://blog.allanglesit.com/2013/01/solaris-11-using-crashplan-for-cloud-backups/</link>
		<comments>http://blog.allanglesit.com/2013/01/solaris-11-using-crashplan-for-cloud-backups/#comments</comments>
		<pubDate>Tue, 15 Jan 2013 12:00:48 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[crashplan]]></category>
		<category><![CDATA[smf]]></category>
		<category><![CDATA[solaris11]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1335</guid>
		<description><![CDATA[I personally use Crashplan for my cloud based backups (I have for over a year).  I use them because they are one of a few (to be honest the only one) who actually have Solaris installers.  The one downside of this is that they do not start the CrashPlanEngine by default (as a service).  However [...]]]></description>
				<content:encoded><![CDATA[<p>I personally use Crashplan for my cloud based backups (I have for over a year).  I use them because they are one of a few (to be honest the only one) who actually have Solaris installers.  The one downside of this is that they do not start the CrashPlanEngine by default (as a service).  However when using the Service Management Framework in Solaris this is really easy to handle yourself&#8230;  For more details how to handle the SMF portion refer to my article &#8220;<a title="Solaris 11: Defining A Service Using Svcbundle and the SMF" href="http://blog.allanglesit.com/2013/01/solaris-11-defining-a-service-using-svcbundle-and-the-smf" target="_blank">Solaris 11: Defining A Service Using Svcbundle and the SMF</a>&#8221; which goes into much more detail on this subject.</p>
<p><strong>Install Crashplan Application</strong></p>
<pre class="brush: plain; title: ; notranslate">#mv CrashPlan_2010-03-08_Solaris.tar.gz /var/spool/pkg/</pre>
<pre class="brush: plain; title: ; notranslate">#tar -xzvf CrashPlan_3.4.1_Solaris.tar.gz</pre>
<pre class="brush: plain; title: ; notranslate">#/usr/sbin/pkgadd</pre>
<p><strong>Create a Service Bundle</strong></p>
<pre class="brush: plain; title: ; notranslate"># svcbundle -o crashplanengine.xml -s service-name=application/crashplanengine -s model=daemon -s start-method=&quot;/opt/sfw/crashplan/bin/CrashPlanEngine start</pre>
<p><strong>Import the Service Bundle</strong></p>
<pre class="brush: plain; title: ; notranslate"># mv crashplanengine.xml /lib/svc/manifest/site/</pre>
<pre class="brush: plain; title: ; notranslate"># svcadm restart manifest-import</pre>
<p><strong>Check the Status of our Service</strong></p>
<pre class="brush: plain; title: ; notranslate"># svcs -a | grep crashplan
online         14:38:53 svc:/application/crashplanengine:default</pre>
<p>Since I have done this my Crashplan service has been much more stable and my backups have been completing more reliably.</p>
<p>REF: http://support.crashplan.com/doku.php/getting_started/installing_crashplan</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/01/solaris-11-using-crashplan-for-cloud-backups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris 11: Defining A Service Using Svcbundle and the SMF</title>
		<link>http://blog.allanglesit.com/2013/01/solaris-11-defining-a-service-using-svcbundle-and-the-smf/</link>
		<comments>http://blog.allanglesit.com/2013/01/solaris-11-defining-a-service-using-svcbundle-and-the-smf/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 12:00:08 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Source Control]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[smf]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris11]]></category>
		<category><![CDATA[source control]]></category>
		<category><![CDATA[svcadm]]></category>
		<category><![CDATA[svcbundle]]></category>
		<category><![CDATA[svccfg]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1332</guid>
		<description><![CDATA[Lately I have been going through an exercise of migrating all of my current services into Solaris 11 (more specifically a zone).  I have already been using similar technology on the Linux side, I use OpenVZ with a mix of Linux distributions.  However I would like to take advantage of ZFS and get a little [...]]]></description>
				<content:encoded><![CDATA[<p>Lately I have been going through an exercise of migrating all of my current services into Solaris 11 (more specifically a zone).  I have already been using similar technology on the Linux side, I use OpenVZ with a mix of Linux distributions.  However I would like to take advantage of ZFS and get a little more simplicity in management. One of the most important hurdles to overcome when making the move from Linux to Solaris is simply the execution of services or processes.  Now in Linux you would write a little init script and then set it to run at certain run levels by either using chkconfig or creating symbolic links into runlevel directories.  For an example of what these init scripts would look like you can see my article &#8220;<a title="Bash: Automatically Mount File Systems on Volume Group if Present" href="http://blog.allanglesit.com/2012/08/bash-automatically-mount-file-systems-on-volume-group-if-present/" target="_blank">Bash: Automatically Mount File Systems on a Volume Group if Present</a>&#8220;.  Now I could simply port my script to run under Solaris (and use the existing rc.d symbolic linking which also exists), however this methodology only starts and stops services on a change of run level and it doesn&#8217;t actually do anything to ensure that these services <strong>stay</strong> up.</p>
<p>Enter the Service Management Facility (SMF) which is built into Solaris starting in Solaris 10.  Basically the idea is that starting and stopping services is similar enough from service to service, that why should we be writing/modifying scripts from service to service.  Why not simply tell it what command to run when starting and then the SMF does the heavy lifting.  The biggest benefit of this is that the SMF can work with other Solaris components to detect the failure of a service and then automatically start it again, making these services more resilient.  This is accomplished by simply acknowledging that services are not simply user processes and thus should not be treated as such.</p>
<p>Now as an example I have moved my mercurial repositories from Linux to a Solaris zone, mercurial has a functionality which can share repositories via HTTP.  This can be done ad-hoc by simply executing the following command.</p>
<p><strong>Determine the Command to Execute</strong></p>
<pre class="brush: plain; title: ; notranslate">$ hg serve</pre>
<p>This will share via HTTP on port 8000.  Now this isn&#8217;t entirely how I want it to operate so lets start by creating a configuration file to change some options.</p>
<pre class="brush: plain; title: ; notranslate">root@source:~# more /etc/mercurial/hgpub.config
[paths]
hg/ = /rpool/repo/hg/pub/*

[web]
allow_archive = gz</pre>
<p>So now to reference the above configuration file we need to modify the command we will execute.</p>
<pre class="brush: plain; title: ; notranslate">$ hg serve --webdir-conf /etc/mercurial/hgpub.conf</pre>
<p>Now we are getting closer.  Another thing I like to do is define the port number, even though I am using the default of 8000.</p>
<pre class="brush: plain; title: ; notranslate">$ hg serve --webdir-conf /etc/mercurial/hgpub.conf -p 8000</pre>
<p>Now we need to use the daemon mode flag to start this in the background and not the foreground.</p>
<pre class="brush: plain; title: ; notranslate">$ hg serve --webdir-conf /etc/mercurial/hgpub.conf -p 8000 -d</pre>
<p>A final test will reveal that we are ready to turn this process into a service.  Kill the service that you manually started.</p>
<p><strong>Create a SMF Bundle</strong></p>
<p>SMF Bundles are XML files which will tell the SMF what to do and when.  You can either copy one that is for another service and modify it to suit or you can use svcbundle to create one specific to your requirements.</p>
<pre class="brush: plain; title: ; notranslate"># svcbundle -o hgpub.xml -s service-name=application/hgpub -s model=daemon -s start-method=&quot;/usr/bin/hg serve --webdir-conf /etc/mercurial/hgpub.config -p 8000 -d&quot;</pre>
<p><strong>Inspect and Modify the SMF Bundle</strong></p>
<pre class="brush: plain; title: ; notranslate"># cat hgpub.xml
&lt;?xml version=&quot;1.0&quot; ?&gt;
&lt;!DOCTYPE service_bundle
SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'&gt;
&lt;!--
Manifest created by svcbundle (2013-Jan-04 21:10:40-0600)
--&gt;
&lt;service_bundle type=&quot;manifest&quot; name=&quot;application/hgpub&quot;&gt;
&lt;service version=&quot;1&quot; type=&quot;service&quot; name=&quot;application/hgpub&quot;&gt;
&lt;!--
The following dependency keeps us from starting until the
multi-user milestone is reached.
--&gt;
&lt;dependency restart_on=&quot;none&quot; type=&quot;service&quot;
name=&quot;multi_user_dependency&quot; grouping=&quot;require_all&quot;&gt;
&lt;service_fmri value=&quot;svc:/milestone/multi-user&quot;/&gt;
&lt;/dependency&gt;
&lt;exec_method timeout_seconds=&quot;60&quot; type=&quot;method&quot; name=&quot;start&quot;
exec=&quot;/usr/bin/hg serve --webdir-conf /etc/mercurial/hgpub.config -p 8000 -d&quot;
/&gt;
&lt;!--
The exec attribute below can be changed to a command that SMF
should execute to stop the service.  See smf_method(5) for more
details.
--&gt;
&lt;exec_method timeout_seconds=&quot;60&quot; type=&quot;method&quot; name=&quot;stop&quot;
exec=&quot;:kill&quot;/&gt;
&lt;!--
The exec attribute below can be changed to a command that SMF
should execute when the service is refreshed.  Services are
typically refreshed when their properties are changed in the
SMF repository.  See smf_method(5) for more details.  It is
common to retain the value of :true which means that SMF will
take no action when the service is refreshed.  Alternatively,
you may wish to provide a method to reread the SMF repository
and act on any configuration changes.
--&gt;
&lt;exec_method timeout_seconds=&quot;60&quot; type=&quot;method&quot; name=&quot;refresh&quot;
exec=&quot;:true&quot;/&gt;
&lt;!--
We do not need a duration property group, because contract is
the default.  Search for duration in svc.startd(1M).
--&gt;
&lt;instance enabled=&quot;true&quot; name=&quot;default&quot;/&gt;
&lt;template&gt;
&lt;common_name&gt;
&lt;loctext xml:lang=&quot;C&quot;&gt;
&lt;!--
Replace this comment with a short name for the
service.
--&gt;
&lt;/loctext&gt;
&lt;/common_name&gt;
&lt;description&gt;
&lt;loctext xml:lang=&quot;C&quot;&gt;
&lt;!--
Replace this comment with a brief description of
the service
--&gt;
&lt;/loctext&gt;
&lt;/description&gt;
&lt;/template&gt;
&lt;/service&gt;
&lt;/service_bundle&gt;

Here we can add a service common name and description to make our service a little easier to use.

1# cat hg-pub.xml
&lt;?xml version=&quot;1.0&quot; ?&gt;
&lt;!DOCTYPE service_bundle
SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'&gt;
&lt;!--
Manifest created by svcbundle (2013-Jan-11 11:43:52-0600)
--&gt;
&lt;service_bundle type=&quot;manifest&quot; name=&quot;application/hgpub&quot;&gt;
&lt;service version=&quot;1&quot; type=&quot;service&quot; name=&quot;application/hgpub&quot;&gt;
&lt;!--
The following dependency keeps us from starting until the
multi-user milestone is reached.
--&gt;
&lt;dependency restart_on=&quot;none&quot; type=&quot;service&quot;
name=&quot;multi_user_dependency&quot; grouping=&quot;require_all&quot;&gt;
&lt;service_fmri value=&quot;svc:/milestone/multi-user&quot;/&gt;
&lt;/dependency&gt;
&lt;exec_method timeout_seconds=&quot;60&quot; type=&quot;method&quot; name=&quot;start&quot;
exec=&quot;/usr/bin/hg serve --webdir-conf /etc/mercurial/hgpub.config -p 8000 -d&quot;
/&gt;
&lt;!--
The exec attribute below can be changed to a command that SMF
should execute to stop the service.  See smf_method(5) for more
details.
--&gt;
&lt;exec_method timeout_seconds=&quot;60&quot; type=&quot;method&quot; name=&quot;stop&quot;
exec=&quot;:kill&quot;/&gt;
&lt;!--
The exec attribute below can be changed to a command that SMF
should execute when the service is refreshed.  Services are
typically refreshed when their properties are changed in the
SMF repository.  See smf_method(5) for more details.  It is
common to retain the value of :true which means that SMF will
take no action when the service is refreshed.  Alternatively,
you may wish to provide a method to reread the SMF repository
and act on any configuration changes.
--&gt;
&lt;exec_method timeout_seconds=&quot;60&quot; type=&quot;method&quot; name=&quot;refresh&quot;
exec=&quot;:true&quot;/&gt;
&lt;!--
We do not need a duration property group, because contract is
the default.  Search for duration in svc.startd(1M).
--&gt;
&lt;instance enabled=&quot;true&quot; name=&quot;default&quot;/&gt;
&lt;template&gt;
&lt;common_name&gt;
&lt;loctext xml:lang=&quot;C&quot;&gt;
hgpub
&lt;/loctext&gt;
&lt;/common_name&gt;
&lt;description&gt;
&lt;loctext xml:lang=&quot;C&quot;&gt;
Mercurial Web Server for Public Repositories
&lt;/loctext&gt;
&lt;/description&gt;
&lt;/template&gt;
&lt;/service&gt;
&lt;/service_bundle&gt;</pre>
<p><strong>Import the Service Bundle</strong></p>
<pre class="brush: plain; title: ; notranslate"># mv hgpub.xml /lib/svc/manifest/site</pre>
<p>Now just restart the manifest-import service to pick up the service.</p>
<pre class="brush: plain; title: ; notranslate"># svcadm restart manifest-import</pre>
<p>Now we can check for unhealthy services by using the below command.</p>
<pre class="brush: plain; title: ; notranslate"># svcs -xv
svc:/system/manifest-import:default (service manifest import)
State: offline since January 11, 2013 12:02:15 PM CST
Reason: Start method is running.
See: http://support.oracle.com/msg/SMF-8000-C4
See: man -M /usr/share/man -s 5 smf_bootstrap
See: /var/svc/log/system-manifest-import:default.log
Impact: This service is not running.</pre>
<p>Above shows you what you will see if you check the services to quickly, you will see the manifest-import service itself in a non-running state, this is due to the import.  Give it a couple seconds and try again and it should clear.</p>
<p>I also saw errors when I did the following.</p>
<ul>
<li>Created Services with port conflicts</li>
<li>Forgot to put the service into daemon mode in the command (use &amp; or nohup for utilities/servers which do not have a daemon mode parameter)</li>
<li>Created Services with duplicate names</li>
</ul>
<p>Below is an example of the output that I got when I forgot to put the service into daemon mode.  The log file mentioned gives much more information on what is actually happening, in this case it is starting it, waiting, and then killing it, over and over again.</p>
<pre class="brush: plain; title: ; notranslate"># svcs -xv
svc:/application/hgpub:default (hgpub)
State: offline* transitioning to online since January 11, 2013 11:58:49 AM CST
Reason: Start method is running.
See: http://support.oracle.com/msg/SMF-8000-C4
See: /var/svc/log/application-hgpub:default.log
Impact: This service is not running.</pre>
<p>If you make a mistake and want to start over then you need to</p>
<ol>
<li>Disable the service (svcadm disable hgpub)</li>
<li>Delete the service (svccfg delete hgpub)</li>
<li>Delete the service bundle in /lib/svc/manifest/site/ (rm /lib/svc/manifest/site/hgpub.xml)</li>
<li>Restart the manifest-import service (svcadm restart manifest-import) - I think a refresh would work here as well, but I have not tested that</li>
</ol>
<p>REF: http://mercurial.selenic.com/wiki/hgserve</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2013/01/solaris-11-defining-a-service-using-svcbundle-and-the-smf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Galaxy Nexus: Android 4.2 Over The Air Update</title>
		<link>http://blog.allanglesit.com/2012/11/google-galaxy-nexus-android-4-2-over-the-air-update/</link>
		<comments>http://blog.allanglesit.com/2012/11/google-galaxy-nexus-android-4-2-over-the-air-update/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 12:00:29 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[General Information]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Battery]]></category>
		<category><![CDATA[Jelly Bean]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Nexus]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1312</guid>
		<description><![CDATA[The Problem I own both a Google Galaxy Nexus (the phone) and a Google Nexus 7 (the tablet). Both of these devices have served me well in the time I had them. Until the Over-the-Air update for Android 4.2 on my Galaxy Nexus. This really ruined my day. Basically the long and short of it [...]]]></description>
				<content:encoded><![CDATA[<p><strong>The Problem</strong></p>
<p>I own both a Google Galaxy Nexus (the phone) and a Google Nexus 7 (the tablet). Both of these devices have served me well in the time I had them. Until the Over-the-Air update for Android 4.2 on my Galaxy Nexus. This really ruined my day. Basically the long and short of it is that the battery took a nose dive after installing this update. Immediately I went from a full day of battery life (only charging it while I slept) to approx 3 hours of battery life. As soon as that happened I changed my email checking settings to manual, so that it would not constantly poll, I also disabled wifi, bluetooth etc. However there was a little gem of information in the Battery Usage reports. Basically it was reporting that ~85% of my battery was being used by &#8220;Exchange Services&#8221; no longer was the screen the biggest consumer of my juice.</p>
<p>After disabling all of these &#8220;extra&#8221; services my battery report changed a bit, basically Exchange Services went to ~81%. Still flatly unacceptable. Especially considering that this would only give approximately 5 hours of battery time.</p>
<p><strong>The Solution</strong></p>
<p>Delete your ActiveSync Mail Account, and re-add it. Before you do this make sure you look over your Sync settings so you know what you are Syncing (email, calendars, contacts) so that you can reconfigure your Sync settings appropriately.</p>
<p>Now I am back to once a day charging except on the heaviest of conference call days.</p>
<p>REF: http://code.google.com/p/android/issues/detail?id=39728</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/11/google-galaxy-nexus-android-4-2-over-the-air-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux KVM: Ubuntu 12.10 with Openvswitch</title>
		<link>http://blog.allanglesit.com/2012/10/linux-kvm-ubuntu-12-10-with-openvswitch/</link>
		<comments>http://blog.allanglesit.com/2012/10/linux-kvm-ubuntu-12-10-with-openvswitch/#comments</comments>
		<pubDate>Wed, 24 Oct 2012 11:00:55 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux-KVM]]></category>
		<category><![CDATA[Switching]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[openvswitch]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1299</guid>
		<description><![CDATA[Today I am revisiting my previous post on Openvswitch on Ubuntu 12.04.  Things have changed since then.  Previously Openvswitch was relatively new and as such the userland tools (with libvirt being the one I use) didn&#8217;t support it yet, so while you could have used Openvswitch by executing the kvm processes for each VM manually.  [...]]]></description>
				<content:encoded><![CDATA[<p>Today I am revisiting my previous post on Openvswitch on Ubuntu 12.04.  Things have changed since then.  Previously Openvswitch was relatively new and as such the userland tools (with libvirt being the one I use) didn&#8217;t support it yet, so while you could have used Openvswitch by executing the kvm processes for each VM manually.  Since this was a predictable problem the Openvswitch guys created a brcompat module, which would take the place of the bridge_utils functionality and expose Openvswitch bridges as legacy bridges.  This allowed the existing userland which already had the legacy bridge functionality builtin to continue to operate the same way.  Anyways as of libvirt 0.9.11 the native Openvswitch functionality is present and supported.  As such I am updating my documentation to include this alternate and preferred method of operation.</p>
<p>Libvirt Versions</p>
<p>Here is the libvirt version present in Ubuntu 12.10.</p>
<pre class="brush: plain; title: ; notranslate"># libvirtd --version
libvirtd (libvirt) 0.9.13</pre>
<p>Here is the libvirt version present in Ubuntu 12.04.</p>
<pre class="brush: plain; title: ; notranslate"># libvirtd --version
libvirtd (libvirt) 0.9.8</pre>
<p>So as we can see above this guide will only work on Ubuntu 12.10 and not on 12.04 or older.  For Ubuntu 12.04, please refer to my older article available here.</p>
<p>Install Updates and Prerequisite Software</p>
<p>Check for updates, and install some commonly used hypervisor utilities along with the openvswitch and kvm stacks.  Note that below I am installing the openvswitch-brcompat package.  I do not think that you need this, however I did install it in my environment in case I was going to need to fail back to the brcompat route, and I haven&#8217;t had the time to validate it without that package installed.  But it is not being used in this configuration.</p>
<pre class="brush: plain; title: ; notranslate"># apt-get install aptitude apt-show-versions ntp ntpdate vim kvm libvirt-bin vlan virtinst virt-manager virt-viewer openssh-server iperf pv openvswitch-controller openvswitch-brcompat openvswitch-switch</pre>
<p>Destroy the Default Libvirt Bridge (virbr0)</p>
<p>We want to delete the default libvirt interface which is created by default to be used for guests (I think it is NAT – I never use it).</p>
<pre class="brush: plain; title: ; notranslate"># virsh net-destroy default
# virsh net-autostart --disable default</pre>
<p>Stop Libvirt and Qemu</p>
<p>This will prevent libvirt from bringing up the legacy bridge.</p>
<pre class="brush: plain; title: ; notranslate"># service libvirt-bin stop
# service qemu-kvm stop</pre>
<p>Purge Ebtables from System</p>
<p>Ebtables was needed when we were using VLANs on bridge-utils, we no longer need this for openvswitch.</p>
<pre class="brush: plain; title: ; notranslate"># aptitude purge ebtables</pre>
<p>Restart the Openvswitch Services</p>
<pre class="brush: plain; title: ; notranslate">#service openvswitch-switch restart
#service openvswitch-controller restart</pre>
<p>Configure Interfaces</p>
<p>Now this configuration is a single interface which will be used both for management of the hypervisor as well as the bridge.  There are three key things to note.  We need to set the physical interface to &#8220;manual&#8221; (instead of &#8220;dhcp&#8221; or &#8220;static&#8221;).  We also need to perform a quick up and down of the physical interface in order to be able to initialize the bridge on it.  Finally we need to setup the configuration of an interface which will connect up to the bridge that we define, this becomes the management interface for the OS.  In this example we are simply using DHCP.  This will show us if it is working quickly, but it can also add some complexity if things are not working, please keep in mind that you might want to just use a static IP address to eliminate that as an issue.</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/network/interfaces
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down

auto ovsbr0p1
iface ovsbr0p1 inet dhcp</pre>
<p>Configure our Network</p>
<p>Configuring the network will be a three step process.  First we define the bridge which I am naming ovsbr0 unlike legacy bridges we don&#8217;t need to stick to brX as a naming convention.</p>
<pre class="brush: plain; title: ; notranslate"># ovs-vsctl add-br ovsbr0</pre>
<p>Second we connect our bridge with its uplink which in this case is eth0.</p>
<pre class="brush: plain; title: ; notranslate"># ovs-vsctl add-port ovsbr0 eth0</pre>
<p>Finally we create a port for our hypervisor to connect up to the bridge and out the physical interface.</p>
<pre class="brush: plain; title: ; notranslate"># ovs-vsctl add-port ovsbr0 ovsbr0p1 -- set interface ovsbr0p1 type=internal</pre>
<p>After all of that we should end up with something like below.</p>
<pre class="brush: plain; title: ; notranslate"># ovs-vsctl show
ed1986fc-830e-4f66-9ce7-92fad0787bb8
Bridge &quot;ovsbr0&quot;
Port &quot;ovsbr0&quot;
Interface &quot;ovsbr0&quot;
type: internal
Port &quot;ovsbr0p1&quot;
Interface &quot;ovsbr0p1&quot;
type: internal
Port &quot;eth0&quot;
Interface &quot;eth0&quot;
ovs_version: &quot;1.4.3&quot;</pre>
<p>Reboot</p>
<pre class="brush: plain; title: ; notranslate"># reboot</pre>
<p>Adjusting Service Sleeps</p>
<p>If your networking seems to hang on boot up.</p>
<p>In /etc/failsafe.conf we need to adjust the sleeps.</p>
<p>Change this&#8230;</p>
<pre class="brush: plain; title: ; notranslate">$PLYMOUTH message --text=&quot;Waiting for network configuration...&quot; || :
sleep 40
$PLYMOUTH message --text=&quot;Waiting up to 60 more seconds for network configuration...&quot; || :
sleep 59
$PLYMOUTH message --text=&quot;Booting system without full network configuration...&quot; || :</pre>
<p>To this&#8230;</p>
<pre class="brush: plain; title: ; notranslate">$PLYMOUTH message --text=&quot;Waiting for network configuration...&quot; || :
sleep 1
$PLYMOUTH message --text=&quot;Waiting up to 60 more seconds for network configuration...&quot; || :
sleep 1
$PLYMOUTH message --text=&quot;Booting system without full network configuration...&quot; || :</pre>
<p>Obviously if you end up needing this change, make sure you reboot again to ensure that it resolved the issue.</p>
<p>Define VM Configuration</p>
<p>I am not going to go into details on how to create a guest from XML, but if you need some help on that refer to my previous article here.</p>
<p>Basically below we have a snippet from a guests XML configuration which configures a single network interface.  You can edit an existing machine configuration using &#8220;virsh edit vmnamehere&#8221;</p>
<pre class="brush: plain; title: ; notranslate">&lt;interface type='bridge'&gt;
&lt;mac address='52:54:00:0f:b4:7a'/&gt;
&lt;source bridge='ovsbr0'/&gt;
&lt;virtualport type='openvswitch'/&gt;
&lt;model type='virtio'/&gt;
&lt;/interface&gt;</pre>
<p>After you have merged the changes in, libvirt will go create a port on Openvswitch for this guest.  Which we can see below as vnet0.</p>
<pre class="brush: plain; title: ; notranslate"># ovs-vsctl show
ed1986fc-830e-4f66-9ce7-92fad0787bb8
Bridge &quot;ovsbr0&quot;
Port &quot;ovsbr0&quot;
Interface &quot;ovsbr0&quot;
type: internal
Port &quot;ovsbr0p1&quot;
Interface &quot;ovsbr0p1&quot;
type: internal
Port &quot;vnet0&quot;
Interface &quot;vnet0&quot;
Port &quot;eth0&quot;
Interface &quot;eth0&quot;
ovs_version: &quot;1.4.3&quot;</pre>
<p>Additionally we can see that in our VM configuration libvirt has added more details, the target dev and parameters interfaceid.  This is how the VM knows which port on the Openvswitch to connect to.</p>
<pre class="brush: plain; title: ; notranslate">&lt;interface type='bridge'&gt;
&lt;mac address='52:54:00:0f:b4:7a'/&gt;
&lt;source bridge='ovsbr0'/&gt;
&lt;virtualport type='openvswitch'&gt;
&lt;parameters interfaceid='a78ac510-2442-1326-c60f-d76c1e830bd6'/&gt;
&lt;/virtualport&gt;
&lt;target dev='vnet0'/&gt;
&lt;model type='virtio'/&gt;
&lt;alias name='net0'/&gt;
&lt;address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/&gt;
&lt;/interface&gt;</pre>
<p>That is all there is to it.  When you bring up your guest. you will have networking exactly as you expected.  But now you open yourself up to a world of possibilities with Openvswitch, such as port mirroring, QoS, LACP and many more.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/10/linux-kvm-ubuntu-12-10-with-openvswitch/feed/</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Windows Server 2012: Storage Pooling</title>
		<link>http://blog.allanglesit.com/2012/10/windows-server-2012-storage-pooling/</link>
		<comments>http://blog.allanglesit.com/2012/10/windows-server-2012-storage-pooling/#comments</comments>
		<pubDate>Tue, 23 Oct 2012 11:00:31 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[refs]]></category>
		<category><![CDATA[spaces]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[storage pool]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows 2012]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1280</guid>
		<description><![CDATA[Windows Server 2012 includes a new storage model.  It follows in the footsteps of ZFS and btrfs, in that it uses a pooled disk model, and attempts to combine all of the functionality of RAID, LVM, and the file system.  Now this looks like a 1.0 from the perspective of integration, however I am quite [...]]]></description>
				<content:encoded><![CDATA[<p>Windows Server 2012 includes a new storage model.  It follows in the footsteps of ZFS and btrfs, in that it uses a pooled disk model, and attempts to combine all of the functionality of RAID, LVM, and the file system.  Now this looks like a 1.0 from the perspective of integration, however I am quite impressed by the implementation from the usability perspective.  While it is not as polished and integrated the flow is consistent and when using the GUI it is very simple to actually configure your storage.  That said this feels like multiple layers.</p>
<p><strong>Usability Comparison to ZFS</strong></p>
<p>To give you an idea of what I would expect lets look at how it works in ZFS.</p>
<p>In ZFS you configure a pool of disks, where we have disk0-4 and want to name the pool tank.</p>
<p># zpool create tank mirror disk0 disk1 mirror disk2 disk3</p>
<p>Then you configure file systems on top of that, in this case fs1 on tank with a size of 10G.</p>
<p># zfs create 10G tank/fs1</p>
<p>Regardless of which camp you are in the above commands are simple to understand and can be easily modified to suit my use case.</p>
<p><strong>Interpretation of What is Being Done</strong></p>
<p>Now as far as I can tell Microsoft has integrated VHD files into the solution in order to expose this functionality.  I don&#8217;t have a technical problem with this, however at this point there is a lot of manual work that has to be done in order to get to the point where I have a usable file system.  So you create your pool with your disks (this is no different from ZFS, however in ZFS this is where your RAID is performed.  Whereas in the Storage Pool/Spaces implementation they are doing that on the file system level (I suspect with software RAID on top of VHD files).  Once the pool is up and configured you create a Virtual Disk, where you will assign your resiliency (RAID level), then initialize the Virtual Disk, create a partition on the Virtual Disk, and finally format the Virtual Disk.  Now I am not saying that you shouldn&#8217;t have to technically do all of these things, however for this to have the seamless experience that they are trying to go for, they will need to put a bit more polish on this.</p>
<p><strong>Find Our Physical Disks</strong></p>
<p>As you can see we have a 25GB disk for our OS, which has the &#8220;CanPool&#8221; as False, this is because it is the system disk, and it is already being used.  We also have 2 10GB disks and 6 5GB disks.  I am doing this testing on my Virtualbox Windows 2012, so the disks are simple to scale out.  So the goal is to get them all in the same pool.  But in order to be more thorough we will be creating the pool with ONLY the 5GB disks, and then adding the 10GB disk, just to prove that we can.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt; Get-PhysicalDisk

FriendlyName        CanPool             OperationalStatus   HealthStatus        Usage                              Size
------------        -------             -----------------   ------------        -----                              ----
PhysicalDisk0       False               OK                  Healthy             Auto-Select                       25 GB
PhysicalDisk1       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk2       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk3       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk4       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk5       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk6       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk7       True                OK                  Healthy             Auto-Select                       10 GB
PhysicalDisk8       True                OK                  Healthy             Auto-Select                       10 GB</pre>
<p><strong>Assign our Disks to a Variable</strong></p>
<pre class="brush: plain; title: ; notranslate">PS&gt; $disk = Get-PhysicalDisk | where {$_.size -eq &quot;5GB&quot;}</pre>
<pre class="brush: plain; title: ; notranslate">PS&gt; $disk

FriendlyName        CanPool             OperationalStatus   HealthStatus        Usage                              Size
------------        -------             -----------------   ------------        -----                              ----
PhysicalDisk1       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk2       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk3       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk4       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk5       True                OK                  Healthy             Auto-Select                        5 GB
PhysicalDisk6       True                OK                  Healthy             Auto-Select                        5 GB</pre>
<p><strong>Check the Name of the Storage SubSystem</strong></p>
<p>I am assuming that you could wildcard this to your PC name or to Storage Spaces, but I didn&#8217;t want to document it that way since I am not sure how it would behave if you have multiple pools.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt; Get-StorageSubSystem

FriendlyName                            HealthStatus                            OperationalStatus
------------                            ------------                            -----------------
Storage Spaces on WIN-PTP6J8CKQNG       Healthy                                 OK</pre>
<p><strong>Create the New Storage Pool</strong></p>
<p>Here we are going to combine the variable we assigned earlier, with the name of the Storage SubSystem to create our new pool.  Then we will check the pools on the machine.  You might have noticed this before, but there is a Primordial pool, which holds disks which have not been assigned.  Sounds like someone at Microsoft has a sense of humor.  It is the goo from which your pool rises.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt; New-StoragePool -StorageSubSystemFriendlyName &quot;Storage Spaces on WIN-PTP6J8CKQNG&quot; -FriendlyName pool0 -PhysicalDisks $disk

FriendlyName            OperationalStatus       HealthStatus            IsPrimordial            IsReadOnly
------------            -----------------       ------------            ------------            ----------
pool0                   OK                      Healthy                 False                   False</pre>
<pre class="brush: plain; title: ; notranslate">PS&gt; Get-StoragePool

FriendlyName            OperationalStatus       HealthStatus            IsPrimordial            IsReadOnly
------------            -----------------       ------------            ------------            ----------
Primordial              OK                      Healthy                 True                    False
pool0                   OK                      Healthy                 False                   False</pre>
<p><strong>Add Additional Disks to the Pool</strong></p>
<p>Assign the new disks to a variable, the same way we did before.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt; $newdisk = Get-PhysicalDisk | where {$_.size -eq &quot;10GB&quot;}</pre>
<pre class="brush: plain; title: ; notranslate">PS&gt; $newdisk

FriendlyName        CanPool             OperationalStatus   HealthStatus        Usage                              Size
------------        -------             -----------------   ------------        -----                              ----
PhysicalDisk7       True                OK                  Healthy             Auto-Select                       10 GB
PhysicalDisk8       True                OK                  Healthy             Auto-Select                       10 GB</pre>
<p>Here we use the Add-PhysicalDisks cmdlet to add them to the Pool.  Now from a user experience this command is hard to find.  It should probably be a Modify-StoragePool or Add-StoragePoolMembers or similar.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt; Add-PhysicalDisk -PhysicalDisks $newdisk -StoragePoolFriendlyName pool0</pre>
<p><strong>Create Virtual Disk (vdisk0)</strong></p>
<p>This is pretty straight forward.  We are just creating a disk.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt;  New-VirtualDisk -StoragePoolFriendlyName pool0 -FriendlyName vdisk0 -ResiliencySettingName mirror -ProvisioningType Thin -Size 30GB

FriendlyName        ResiliencySettingNa OperationalStatus   HealthStatus        IsManualAttach                     Size
me
------------        ------------------- -----------------   ------------        --------------                     ----
vdisk0              Mirror              OK                  Healthy             False                             30 GB</pre>
<p><strong>Initialize Disk (vdisk0)</strong></p>
<p>The next step is to initialize it.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt; Get-VirtualDisk vdisk0 | Initialize-Disk -PartitionStyle GPT</pre>
<p><strong>Create and Initialize Virtual Disk (vdisk1)</strong></p>
<p>I combined the above two steps into one, via some powershell magic.  Functionally the same things are happening though.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt;  New-VirtualDisk -StoragePoolFriendlyName pool0 -FriendlyName vdisk1 -ResiliencySettingName mirror -ProvisioningType Thin -Size 30GB | Initialize-Disk -PartitionStyle GPT</pre>
<p><strong>Partition and Format the Virtual Disk</strong></p>
<p>Here is where it gets interesting.  I have combined everything into one step, but we have two distinct actions, the creation of the partition, and the formatting of the volume that is created (via the partitioning).  In the formatting, you have your choice of file system (of course the FAT&#8217;s but also NTFS and ReFS which is the interesting one).  If you are logged into the GUI this step will also result in a Windows Explorer pop-up asking if you want to format the disk, you can cancel that you are formatting via the command line.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt;  get-disk | where {$_.uniqueid -eq ((Get-VirtualDisk vdisk0).UniqueId)} | New-Partition -UseMaximumSize -AssignDriveLetter | Format-Volume -FileSystem NTFS

Confirm
Are you sure you want to perform this action?
Warning, all data on the volume will be lost!
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is &quot;Y&quot;):

DriveLetter       FileSystemLabel  FileSystem       DriveType        HealthStatus        SizeRemaining             Size
-----------       ---------------  ----------       ---------        ------------        -------------             ----
E                                  NTFS             Fixed            Healthy                  29.78 GB         29.87 GB</pre>
<p>Also if you&#8217;d like to do the above without having to confirm your action, pass Format-Volume with -Confirm:$false to avoid that confirmation.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt;  get-disk | where {$_.uniqueid -eq ((Get-VirtualDisk vdisk0).UniqueId)} | New-Partition -UseMaximumSize -AssignDriveLetter | Format-Volume -FileSystem NTFS -Confirm:$false</pre>
<p>Well there you have it.  All and all I think it is an interesting concept, though it definitely needs some work around integrating the components.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/10/windows-server-2012-storage-pooling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Server 2012: NIC Teaming</title>
		<link>http://blog.allanglesit.com/2012/10/windows-server-2012-nic-teaming/</link>
		<comments>http://blog.allanglesit.com/2012/10/windows-server-2012-nic-teaming/#comments</comments>
		<pubDate>Mon, 22 Oct 2012 11:00:05 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[aggregation]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[teaming]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows 2012]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1269</guid>
		<description><![CDATA[I don&#8217;t tend to use a lot of Windows in recent years, but if you look at my past articles I used to do quite a bit around Hyper-V, DFS, Exchange, and various other Windows Services.  One thing that was always frustrating is the inconsistent experience around NIC teaming.  Basically Teaming allows you to gain [...]]]></description>
				<content:encoded><![CDATA[<p>I don&#8217;t tend to use a lot of Windows in recent years, but if you look at my past articles I used to do quite a bit around Hyper-V, DFS, Exchange, and various other Windows Services.  One thing that was always frustrating is the inconsistent experience around NIC teaming.  Basically Teaming allows you to gain throughput and resiliency by having multiple physical NICs listen over the same logical NIC.  The reason of this inconsistency was that teaming was always provided by the hardware/driver manufacturer so features and configurations would be implemented separately.</p>
<p>Well the good news is that it appears that Microsoft has decided to reverse course with this in Windows Server 2012.  Which is most definitely a good thing for users.</p>
<p>So while I don&#8217;t plan on going too deep into Windows 2012 I thought this would be worth a quick run through.</p>
<p><a href="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-001.png"><img class="aligncenter size-medium wp-image-1270" title="windows-server-2012-nic-team-001" alt="" src="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-001-300x147.png" width="300" height="147" /></a></p>
<p style="text-align: center;">Figure 1-1:  Above you will find the Local Server view of the Server Manager tool.  You will notice on the left near the center we have our 2 ethernet connections.  In my case these are inside of Virtualbox VM and these are NAT connections.  But directly above that you see &#8220;Nic Teaming: Disabled&#8221;</p>
<p><a href="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-002.png"><img class="aligncenter size-medium wp-image-1271" title="windows-server-2012-nic-team-002" alt="" src="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-002-300x212.png" width="300" height="212" /></a></p>
<p style="text-align: center;">Figure 1-2:  Above you will notice the NIC Teaming Details screen.  You get here by clicking on Disabled in Figure 1-1.  Notice in the bottom left we have no Teams configured, and in the bottom right we have 2 adapters available for teaming.</p>
<p><a href="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-003.png"><img class="aligncenter size-medium wp-image-1272" title="windows-server-2012-nic-team-003" alt="" src="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-003-300x218.png" width="300" height="218" /></a></p>
<p style="text-align: center;">Figure 1-3:  Here we simply highlight the available interfaces, then in the TASKS menu select Add to New Team.</p>
<p><a href="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-004.png"><img class="aligncenter size-medium wp-image-1273" title="windows-server-2012-nic-team-004" alt="" src="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-004-300x284.png" width="300" height="284" /></a></p>
<p style="text-align: center;">Figure 1-4:  Assign a Team Name.  Here I am using team0.</p>
<p><a href="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-005.png"><img class="aligncenter size-medium wp-image-1274" title="windows-server-2012-nic-team-005" alt="" src="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-005-300x109.png" width="300" height="109" /></a></p>
<p style="text-align: center;">Figure 1-5:  Now we have a working Team which contains the two Ethernet Adapters.</p>
<p><a href="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-006.png"><img class="aligncenter size-medium wp-image-1275" title="windows-server-2012-nic-team-006" alt="" src="http://blog.allanglesit.com/wp-content/uploads/2012/10/windows-server-2012-nic-team-006-300x108.png" width="300" height="108" /></a></p>
<p style="text-align: center;">Figure 1-6:  Just for giggles I switched the second Ethernet Adapter in Virtualbox from &#8220;NAT&#8221; to &#8220;Not Attached&#8221; to simulate network failure, and above is what I got.</p>
<p>Now I don&#8217;t like to do anything that I can&#8217;t do from the command line, frankly that is mostly because that is far easier to document then having to worry about screenshots.  So lets do the same thing with Powershell.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt; New-NetLbfoTeam -Name team0 -TeamMembers (Get-NetAdapter | where {$_.name -match &quot;Ethernet&quot;}).name

Confirm
Are you sure you want to perform this action?
Creates Team:'team0' with TeamMembers:{'Ethernet 2', 'Ethernet'}, TeamNicName:'team0', TeamingMode:'SwitchIndependent'
and LoadBalancingAlgorithm:'TransportPorts'.
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is &quot;Y&quot;):

Name                   : team0
Members                : {Ethernet 2, Ethernet}
TeamNics               : team0
TeamingMode            : SwitchIndependent
LoadBalancingAlgorithm : TransportPorts
Status                 : Down</pre>
<p>As we can see from the above output we can choose the Teaming Mode and Load Balancing Algorithm.  For the Teaming Mode you can use Switch Indepent, Static, and LACP.  The latter two options require the switch to support and/or be configured to allow that configuration to work.  You have your choice of Load Balancing Algorithms (IP Address, MAC Address, Transport Ports, and Hyper-V Port) the first three use the IP/MAC/Port from the source and destination to create a hash and then balance the traffic appropriately, the Hyper-V Port doesn&#8217;t do any hashing as far as I can tell, it simply splits the Hyper-V Ports over the interfaces.</p>
<p>We can also see that the status is &#8220;down&#8221; but fear not.  Give it about 15 seconds and then look at the team again.</p>
<pre class="brush: plain; title: ; notranslate">PS&gt; Get-NetLbfoTeam

Name                   : team0
Members                : {Ethernet 2, Ethernet}
TeamNics               : team0
TeamingMode            : SwitchIndependent
LoadBalancingAlgorithm : TransportPorts
Status                 : Up</pre>
<p>This will give you network based teaming, there are also some additional options to allow you to use LACP and other algorithms.  For me this is a big change, but the more impactful change is the change in Network Connection names.  Now they seem to be using Ethernet followed by Ethernet 2 and so on.  Which for me is far superior to Local Area Connection followed by Local Area Connection 2 and so on.  I think it would have been better to use Ethernet0 or Ethernet1 just to give you consistent numbering, through multiple interfaces.  But I will take what I can get.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/10/windows-server-2012-nic-teaming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux-LVM: Resize Partition to Grow LVM Volume Group</title>
		<link>http://blog.allanglesit.com/2012/08/linux-lvm-resize-partition-to-grow-lvm-volume-group/</link>
		<comments>http://blog.allanglesit.com/2012/08/linux-lvm-resize-partition-to-grow-lvm-volume-group/#comments</comments>
		<pubDate>Mon, 20 Aug 2012 11:00:56 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LVM2]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[lvm2]]></category>
		<category><![CDATA[pvresize]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1250</guid>
		<description><![CDATA[Logical Volume Manager makes the dynamic expansion of file systems dead stupid simple.  However there is a weakness, if you are using a partitioned file system as your Physical Volume (PV) then you will end up needing to expand the file system if you ever need to grow the actual storage.  This can be avoided [...]]]></description>
				<content:encoded><![CDATA[<p>Logical Volume Manager makes the dynamic expansion of file systems dead stupid simple.  However there is a weakness, if you are using a partitioned file system as your Physical Volume (PV) then you will end up needing to expand the file system if you ever need to grow the actual storage.  This can be avoided by using the actual physical device /dev/sda as the PV, however if this is the same volume where your /boot partition lives then you will have no choice but to partition it out since /boot cannot reside on a Logical Volume (LV).  The other way you can avoid this is by simply creating a second partition on the same disk and adding it as a new PV to the existing Volume Group (VG).  This is preferable as there is far less room for error than in this procedure, but I personally find that method a little more confusing to inherit then a straight forward single partition made an LV.</p>
<p>Please keep in mind that this series of changes is very high risk.  Please make sure you (1) understand fully what you are doing (2) understand fully why you are doing it (3) have backups of the data if it is of any importance to you.  If you do something stupid (even if I tell you to do it I will not be held responsible for any consequences &#8211; scared yet?).</p>
<p><strong>Check our Current Configuration</strong></p>
<p>Below you will see the 4 Logical Volumes, 1 Volume Group and 1 Physical Volume that we have.</p>
<pre class="brush: plain; title: ; notranslate"># lvs
LV        VG      Attr   LSize   Origin Snap%  Move Log Copy%  Convert
lv_root  LocalVG -wi-ao 100.00G
lv_swap LocalVG -wi-ao  24.00G
lv_data1  LocalVG -wi-ao  30.00G
lv_data2  LocalVG -wi-a-  30.00G</pre>
<p>You will see here we have ~94GB of free space in our Volume Group.  Now in this particular situation we actually have ~300GB+ due to a change in the RAID configuration (or in a more common scenario an expansion of a virtual hard disk file).</p>
<pre class="brush: plain; title: ; notranslate">#vgs
VG      #PV #LV #SN Attr   VSize   VFree
LocalVG   1   4   0 wz--n- 278.74G 94.74G</pre>
<p>Here is where the issue ultimately lies.  Since this OS was installed using LVM on top of a disk partition instead of the whole disk (there is no other option I am afraid when it comes to root installations).  We will need to expand the partition in order to see this on the LVM Physical Volume.</p>
<pre class="brush: plain; title: ; notranslate"># pvs
PV         VG      Fmt  Attr PSize   PFree
/dev/sda2  LocalVG lvm2 a-   278.74G 94.74G</pre>
<p><strong>Make our Change Plan</strong></p>
<p>Now in order to &#8220;extend&#8221; the partition we actually have to delete the partition and then recreate it.  The important part of this is that we want to ensure that when we are creating our new partition that we start it on the exact same block (we will end it on a further block, but we need to start in the right place).  Don&#8217;t try and get smart and relocate the partition in addition to extending it.  That would classify as stupid.</p>
<pre class="brush: plain; title: ; notranslate"># fdisk -l /dev/sda

Disk /dev/sda: 598.8 GB, 598879502336 bytes
255 heads, 63 sectors/track, 72809 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          16      128488+  83  Linux
/dev/sda2              17       36404   292286610   8e  Linux LVM</pre>
<p>From the above output we can see a few things&#8230;</p>
<p>1) The disk is ~598GB<br />
2) The last cylinder on the disk is 72809<br />
3) The last cylinder on our (/dev/sda2) partition is 36404<br />
4) The first cylinder on our (/dev/sda2) partition is 17<br />
5) The type of the partition is 8e which means Linux LVM.</p>
<p>So this will consist of 3 changes to the partition changes.</p>
<p>1) Delete /dev/sda2<br />
2) Create /dev/sda2 starting on the 17th cylinder and ending on the 72,809th cylinder (the last cylinder).<br />
3) Set the type of /dev/sda2 to 8e.</p>
<p><strong>Implement our Change Plan</strong></p>
<p>Now that we know what we have to do, and we have written down all of these key details.  Keep in mind I actually mean written down on paper, if you sustain a power outage during the change you will not have a file system or a terminal window to reference the pre-existing configuration and you will need to boot to a live-cd to rebuild your partition table from your notes.</p>
<pre class="brush: plain; title: ; notranslate"># fdisk /dev/sda

The number of cylinders for this disk is set to 72809.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 598.8 GB, 598879502336 bytes
255 heads, 63 sectors/track, 72809 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          16      128488+  83  Linux
/dev/sda2              17       36404   292286610   8e  Linux LVM

Command (m for help): d
Partition number (1-4): 2

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (17-72809, default 17):
Using default value 17
Last cylinder or +size or +sizeM or +sizeK (17-72809, default 72809):
Using default value 72809

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/sda: 598.8 GB, 598879502336 bytes
255 heads, 63 sectors/track, 72809 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          16      128488+  83  Linux
/dev/sda2              17       72809   584709772+  8e  Linux LVM

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.</pre>
<p><strong>Reboot</strong></p>
<p>So hopefully you noticed that after I was done, I printed the configuration and double checked my work against my plan to ensure that I had it right.  Next we must reboot in order to re-read your partition table.</p>
<pre class="brush: plain; title: ; notranslate"># reboot

Broadcast message from root (pts/0) (Fri Aug 10 11:25:58 2012):

The system is going down for reboot NOW!</pre>
<p><strong>Resize the LVM Physical Volume</strong></p>
<p>OK so now that we have extended the partition and rebooted, LVM will show the same characteristics as before we extended the partition.  The next step is to perform a pvresize so that LVM will re-examine the disk characteristics of the physical volume, and then take advantage of any new space.</p>
<pre class="brush: plain; title: ; notranslate"># pvs
PV         VG      Fmt  Attr PSize   PFree
/dev/sda2  LocalVG lvm2 a-   278.74G 94.74G</pre>
<pre class="brush: plain; title: ; notranslate"># pvresize /dev/sda2
Physical volume &quot;/dev/sda2&quot; changed
1 physical volume(s) resized / 0 physical volume(s) not resized</pre>
<pre class="brush: plain; title: ; notranslate"># vgs
VG      #PV #LV #SN Attr   VSize   VFree
LocalVG   1   4   0 wz--n- 557.62G 373.62G</pre>
<p><strong>Enjoy</strong></p>
<p>That was it now, we have managed to extend the underlying partition which is the LVM Physical Volume.  This has enabled us to seamlessly extend our Volume Group, and now the full disk is being used in our environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/08/linux-lvm-resize-partition-to-grow-lvm-volume-group/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Solaris Virtualization: Using Logical Domains on Solaris 11 Part Three</title>
		<link>http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-three/</link>
		<comments>http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-three/#comments</comments>
		<pubDate>Wed, 08 Aug 2012 11:00:58 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[SPARC Logical Domains]]></category>
		<category><![CDATA[ldm]]></category>
		<category><![CDATA[ldoms]]></category>
		<category><![CDATA[logical domains]]></category>
		<category><![CDATA[solaris11]]></category>
		<category><![CDATA[sparc]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1226</guid>
		<description><![CDATA[In our previous articles we built the foundation of our Logical Domains environment, which then enabled us to create a Logical Domain in part two.  Now in the final article in this series we will be connecting to and performing the installation of the operating system. Solaris Virtualization: Using Logical Domains on Solaris 11 Part [...]]]></description>
				<content:encoded><![CDATA[<p>In our previous articles we built the foundation of our Logical Domains environment, which then enabled us to create a Logical Domain in part two.  Now in the final article in this series we will be connecting to and performing the installation of the operating system.</p>
<p><a title="Solaris Virtualization: Using Logical Domains on Solaris 11 Part One" href="http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-one">Solaris Virtualization: Using Logical Domains on Solaris 11 Part One</a><br />
<a title="Solaris Virtualization: Using Logical Domains on Solaris 11 Part Two" href="http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-two">Solaris Virtualization: Using Logical Domains on Solaris 11 Part Two</a></p>
<p>Before we start the domain, we need to bind the associated resources to the domain.  This will also show us the port that the console is running on, so that we can connect to it.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  UART    4     4G       0.8%  2h 44m
t4-g1            inactive   ------          8     4G
root@t4:~# ldm bind-domain t4-g1
root@t4:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  UART    4     4G       3.0%  2h 45m
t4-g1            bound      ------  5000    8     4G    </pre>
<p>In the above example we can see that once we &#8220;bind-domain&#8221; this is binding specific hardware resources to the domain.  In this case we can now see that we have a port for the console connections.  For this domain it is 5000.  So if we telnet to port 5000 on the localhost we will end up connected to the console.  I personally like to connect prior to starting the domain, because I prefer to watch the boot up process, so that I know everything is working properly, this means I will have a separate ssh session which I use for telnet.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# telnet localhost 5000
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to t4.
Escape character is '^]'.

Connecting to console &quot;t4-g1&quot; in group &quot;t4-g1&quot; ....
Press ~? for control options ..</pre>
<p>Start the domain.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm start-domain t4-g1
LDom t4-g1 started</pre>
<p>Observe boot process.  During the below boot process we can see a couple of things.  Most importantly we see that the boot fails, with a &#8220;Can&#8217;t open boot device&#8221; this is expected as we are attempting to boot from disk0 which has not been installed yet.</p>
<pre class="brush: plain; title: ; notranslate">SPARC T4-1, No Keyboard
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.33.1, 4096 MB memory available, Serial #83496026.
Ethernet address 0:14:4f:fa:c:5a, Host ID: 84fa0c5a.

Boot device: disk0  File and args:
Bad magic number in disk label
ERROR: /virtual-devices@100/channel-devices@200/disk@0: Can't open disk label package

ERROR: boot-read fail

Evaluating:

Can't open boot device

{0} ok</pre>
<p>We will be dumped to the ok prompt for the domain, from here we can simply select to boot from the iso that you defined earlier in the domain setup.  In my case I named the device s11.iso, so if you do a devalias you would see s11.iso as an alias to a device.</p>
<pre class="brush: plain; title: ; notranslate">{0} ok boot s11.iso</pre>
<p>Just a quick note, the escape character for telnet is listed as &#8216;^]&#8217; in the beginning of the telnet session, this is CTRL + ] once you have returned the the telnet&gt; prompt you can type quit.</p>
<p>Now in my environment I went through the install of Solaris 11, since it was the disk I had readily available, you can additionally use Soalris 10, or OpenSolaris if you so desire.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-three/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Solaris Virtualization: Using Logical Domains on Solaris 11 Part Two</title>
		<link>http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-two/</link>
		<comments>http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-two/#comments</comments>
		<pubDate>Tue, 07 Aug 2012 11:00:07 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[SPARC Logical Domains]]></category>
		<category><![CDATA[ldm]]></category>
		<category><![CDATA[ldoms]]></category>
		<category><![CDATA[logical domains]]></category>
		<category><![CDATA[solaris11]]></category>
		<category><![CDATA[sparc]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1224</guid>
		<description><![CDATA[In our previous article we went through the process of preparing a Solaris 11 for SPARC machine as a Logical Domain hypervisor.  Now that we have laid out our foundation we are ready to create some Logical Domains. Solaris Virtualization: Using Logical Domains on Solaris 11 Part One Create the Logical Domain Configure Devices We [...]]]></description>
				<content:encoded><![CDATA[<p>In our previous article we went through the process of preparing a Solaris 11 for SPARC machine as a Logical Domain hypervisor.  Now that we have laid out our foundation we are ready to create some Logical Domains.</p>
<p><a title="Solaris Virtualization: Using Logical Domains on Solaris 11 Part One" href="http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-one">Solaris Virtualization: Using Logical Domains on Solaris 11 Part One</a></p>
<p><strong>Create the Logical Domain</strong></p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm add-domain t4-g1</pre>
<p><strong>Configure Devices</strong></p>
<p>We will need to add devices to our newly created domain.  Here we will add virtual CPUs, memory, and a network device.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm add-vcpu 8 t4-g1
root@t4:~# ldm add-memory 4G t4-g1
root@t4:~# ldm add-vnet vnet1 primary-vsw0 t4-g1</pre>
<p><strong>Configure Storage Devices</strong></p>
<p>Add the installation media to our domain using an iso image which we added to the Virtual Disk Service service which we created in Part One.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm add-vdisk s11.iso solaris11_media@primary-vds0 t4-g1</pre>
<p>Create a couple of ZFS volumes for use by the domain, we are using the -p option to create the parent file system with the name of the logical domain for organization.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# zfs create -p -V 20G rpool/ldoms/t4-g1/disk0
root@t4:~# zfs create -p -V 20G rpool/ldoms/t4-g1/disk1</pre>
<p>Add the ZFS volumes to the Virtual Disk Server service (primary-vds0).</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm add-vdsdev /dev/zvol/dsk/rpool/ldoms/t4-g1/disk0 t4-g1-disk0@primary-vds0
root@t4:~# ldm add-vdsdev /dev/zvol/dsk/rpool/ldoms/t4-g1/disk1 t4-g1-disk1@primary-vds0</pre>
<p>Configure our domain with our disk storage devices (disk0 and disk1) from the Virtual Disk Server service.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm add-vdisk disk0 t4-g1-disk0@primary-vds0 t4-g1
root@t4:~# ldm add-vdisk disk1 t4-g1-disk1@primary-vds0 t4-g1</pre>
<p><strong>Configure Boot Devices</strong></p>
<p>We want our domain to auto-boot and use disk0 as the primary boot device.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm set-var auto-boot\?=true t4-g1
root@t4:~# ldm set-var boot-device=disk0 t4-g1</pre>
<p><strong>Set the Host ID</strong></p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm set-domain hostid=85e92821 t4-g1</pre>
<p>Additionally the hostid option can be passed in the add-domain command when you originally create the domain.</p>
<p>Tomorrow we will go through the process of connecting to the console of the Logical Domain and then install an operating system.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris Virtualization: Using Logical Domains on Solaris 11 Part One</title>
		<link>http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-one/</link>
		<comments>http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-one/#comments</comments>
		<pubDate>Mon, 06 Aug 2012 11:00:56 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[SPARC Logical Domains]]></category>
		<category><![CDATA[ldm]]></category>
		<category><![CDATA[ldoms]]></category>
		<category><![CDATA[logical domains]]></category>
		<category><![CDATA[solaris11]]></category>
		<category><![CDATA[sparc]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1209</guid>
		<description><![CDATA[Solaris 11 for SPARC, as well as previous versions of Solaris, include a neat little technology called Logical Domains (which has been rebranded as Oracle VM for SPARC).  Logical Domains are implemented in the SPARC processor. This series is going to focus on the basic administration of a Logical Domains environment using the basic command [...]]]></description>
				<content:encoded><![CDATA[<p>Solaris 11 for SPARC, as well as previous versions of Solaris, include a neat little technology called Logical Domains (which has been rebranded as Oracle VM for SPARC).  Logical Domains are implemented in the SPARC processor.</p>
<p>This series is going to focus on the basic administration of a Logical Domains environment using the basic command line tools of the Solaris 11 Operating System.  In Part One we will go over what it takes to configure a Solaris 11 installation to be a Logical Domains hypervisor.  In Part Two we will document defining and configuring Logical Domains.  In Part Three we will discuss connecting to the Logical Domain in order to perform an installation of the operating system.</p>
<p>A little bit about my environment.  I am using a Oracle Sun SPARC T4-1 which has a single socket eight-core 2.85GHz SPARC T4 Processor.  Each processor core on this model has 8 threads, giving us a total of 64 processor threads.  Lets take a look at our environment shall we?</p>
<p><strong>Check Operating System Version</strong></p>
<p>This is the released version of Solaris 11 for SPARC, which of course means it can only be used on the SPARC processor architecture.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# uname -a
SunOS t4 5.11 11.0 sun4v sparc sun4v</pre>
<p><strong>View Logical Domains Software Version</strong></p>
<p>The release version of Solaris 11 for SPARC comes with Logical Domains 2.1.  If you have purchased support and configured access to the repositories then pkg update will give you access to Logical Domains 2.2.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm -V

Logical Domains Manager (v 2.1.0.4)
Hypervisor control protocol v 1.7
Using Hypervisor MD v 1.3

System PROM:
Hostconfig      v. 1.1.1        @(#)Hostconfig 1.1.1 2011/08/03 23:04
Hypervisor      v. 1.10.1.      @(#)Hypervisor 1.10.1.b 2011/09/12 09:56
OpenBoot        v. 4.33.1       @(#)OpenBoot 4.33.1 2011/08/03 10:34</pre>
<p><strong>View Existing Logical Domains</strong></p>
<p>Here we see the specifics of our physical machine.  The primary domain has all of the resources and before we will be able to allocate resources to other Logical domains we will need to remove some from the primary domain.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-c--  UART    64    32256M   0.0%  4d 23h 30m</pre>
<p><strong>Create Services for Control Domain</strong></p>
<p>Here we are creating the Virtual Console Concentrator service.  This is what allows us to connect to the console of the domains for installation and reconfiguration.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm add-vcc port-range=5000-5100 primary-vcc0 primary</pre>
<p>This is the Virtual Disk Server service.  This is used to hand out disk devices to the domains.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm add-vds primary-vds0 primary</pre>
<p>This is the Virtual Switch service.  It provides networking to the domains.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm add-vsw net-dev=net0 primary-vsw0 primary</pre>
<p>Lets review our changes.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm list-services primary
VCC
NAME             LDOM             PORT-RANGE
primary-vcc0     primary          5000-5100

VSW
NAME             LDOM             MAC               NET-DEV   ID   DEVICE     LINKPROP   DEFAULT-VLAN-ID PVID VID                  MTU   MODE   INTER-VNET-LINK
primary-vsw0     primary          00:14:4f:fb:bd:bd net0      0    switch@0              1               1                         1500         on

VDS
NAME             LDOM             VOLUME         OPTIONS          MPGROUP        DEVICE
primary-vds0     primary  </pre>
<p><strong>Configure the Control Domain</strong></p>
<p>Look at the existing domains.  By default we have primary, which is essentially the host operating system.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-c--  UART    64    32256M   0.0%  5d 53m</pre>
<p>Reduce the number of vCPU available to the control domain.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm set-vcpu 4 primary</pre>
<p>Reduce the amount of RAM available to the control domain.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm set-memory 4G primary</pre>
<p>Reconfigure primary domain to reflect changes.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm start-reconf primary
Initiating a delayed reconfiguration operation on the primary domain.
All configuration changes for other domains are disabled until the primary
domain reboots, at which time the new configuration for the primary domain
will also take effect.</pre>
<p>Create alternate configuration file.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm add-config primary-config
root@t4:~# ldm list-config
factory-default
primary-config [current]</pre>
<p>Enable the Virtual Network Terminal Server Daemon.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# svcadm enable vntsd
root@t4:~# svcs | grep vntsd
online         16:40:01 svc:/ldoms/vntsd:default</pre>
<p>Reboot.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# reboot</pre>
<p>After a reboot, the primary domain reflects the new memory and vCPU configuration.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  UART    4     4G       0.4%  1h 4m
</pre>
<p><strong>Create Install Media Repository</strong></p>
<p>Create a ZFS file system to hold the iso files.  The -p will create the parent file system /rpool/ldoms as well.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# zfs create -p rpool/ldoms/iso</pre>
<p>Add the Solaris 11 and Solaris 10 iso files to the Virtual Disk Server service.</p>
<pre class="brush: plain; title: ; notranslate">root@t4:~# ldm add-vdsdev /rpool/ldoms/iso/oracle-solaris-11-11.11-sparc.iso solaris11_media@primary-vds0
root@t4:~# ldm add-vdsdev /rpool/ldoms/iso/oracle-solaris-10-8.11-sparc.iso solaris10_media@primary-vds0</pre>
<p>Now we have a working environments to support the Logical Domains that we will be adding tomorrow in part two.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/08/solaris-virtualization-using-logical-domains-on-solaris-11-part-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash: Automatically Mount File Systems on Volume Group if Present</title>
		<link>http://blog.allanglesit.com/2012/08/bash-automatically-mount-file-systems-on-volume-group-if-present/</link>
		<comments>http://blog.allanglesit.com/2012/08/bash-automatically-mount-file-systems-on-volume-group-if-present/#comments</comments>
		<pubDate>Thu, 02 Aug 2012 11:00:20 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LVM2]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[has-code]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm2]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[removable disk]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1169</guid>
		<description><![CDATA[In my laptop I have a solid state disk, and frankly I am way past addicted to solid state disks, but what you get in performance you lose in capacity.  As such I have had to be creative with how I can have the capacity and the performance that I need.  Lately the solution has [...]]]></description>
				<content:encoded><![CDATA[<p>In my laptop I have a solid state disk, and frankly I am way past addicted to solid state disks, but what you get in performance you lose in capacity.  As such I have had to be creative with how I can have the capacity and the performance that I need.  Lately the solution has been to have a spinning disk in the slot that would normally be occupied by my CD/DVD drive.  However the problem with this, revealed itself to be that my Fedora install would actually fail to boot when it tried and failed to mount the file systems if this device was not present.  So my first &#8220;solution&#8221; was to set noauto in the /etc/fstab for these secondary file systems.  Which presented a new problem&#8230;  I would forget to manually mount these devices before launching Virtualbox to start my VMs.  So I decided that I would need to have an auto-mount script which would check for the volume group to be present and then if it was mount the file systems contained within the /etc/fstab which live on the volume group.</p>
<p><strong>Create the Service Script</strong></p>
<p>Below you will see the script I created.  This script will test for the presence of a volume group, and if present on invocation (boot up or manual) then it will mount each logical volume defined in the /etc/fstab of the present volume group.</p>
<p>Name       :  custom_mount.sh<br />
Version   :  1.0.3<br />
MD5        :  0b8cf3b0b5c9d3c16e4384fde88e8659<br />
SHA256  :  877ef66ab464e71172986fa9cd5510f0ad6752f05a414af703878d7e058c845b<br />
URL         :  <a href="http://source.allanglesit.net/pub/custom_mount.sh">http://source.allanglesit.net/pub/custom_mount.sh</a></p>
<pre class="brush: bash; collapse: true; first-line: 1; gutter: true; light: false; title: Expand custom_mount.sh; toolbar: true; notranslate">#!/bin/bash
# chkconfig: 345 85 15
# description: Will automatically mount a removable device if present.
#
#: Script Name    : custom_mount.sh
#: Version    : 1.0.3
#: Author    : Matthew Mattoon - http://blog.allanglesit.com
#: Date Created    : August 15, 2012
#: Date Updated    : February 20, 2013
#: Description    : Automount Removable Logical Volumes Script.
#: Examples    : custom_mount.sh ACTION
#:         : custom_mount.sh start

vgtest=&quot;vg_data&quot;
vgs=`vgs | grep $vgtest`

case &quot;$1&quot; in
start)
if [ -n &quot;$vgs&quot; ]
then
echo &quot;Logical Volume Group: $vgtest present.&quot;
mounts=`cat /etc/fstab | grep $vgtest | grep noauto | tr '\t' ' ' | tr -s ' ' | cut -d &quot; &quot; -f 2`
for mount in $mounts
do
if [ -z &quot;`mount | grep $mount`&quot; ]
then
echo &quot;Mounting $mount file system...&quot;
mount $mount
else
echo &quot;File system $mount is already mounted...&quot;
fi
done
else
echo &quot;Logical Volume Group: $vgtest not present.&quot;
exit 1
fi
;;
stop)
if [ -n &quot;$vgs&quot; ]
then
echo &quot;Logical Volume Group: $vgtest present.&quot;
mounts=`cat /etc/fstab | grep $vgtest | grep noauto | tr '\t' ' ' | tr -s ' ' | cut -d &quot; &quot; -f 2`
for mount in $mounts
do
if [ -n &quot;`mount | grep $mount`&quot; ]
then
echo &quot;Unmounting $mount file system...&quot;
umount $mount
else
echo &quot;File system $mount is already unmounted...&quot;
fi
done
else
echo &quot;Logical Volume Group: $vgtest not present.&quot;
exit 1
fi
;;
*)
echo &quot;Usage: $0 start&quot;
exit 1
esac</pre>
<p><strong>Create the Service to Auto Start</strong></p>
<p>Based on my /etc/init.d/custom_mount script it will start in run levels 3, 4, and 5.</p>
<pre class="brush: plain; title: ; notranslate"># chkconfig --add custom_mount</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/08/bash-automatically-mount-file-systems-on-volume-group-if-present/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris 11 on SPARC: What the Piss is the OK Prompt</title>
		<link>http://blog.allanglesit.com/2012/08/solaris-11-on-sparc-what-the-piss-is-the-ok-prompt/</link>
		<comments>http://blog.allanglesit.com/2012/08/solaris-11-on-sparc-what-the-piss-is-the-ok-prompt/#comments</comments>
		<pubDate>Wed, 01 Aug 2012 11:00:43 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[open boot prom]]></category>
		<category><![CDATA[solaris11]]></category>
		<category><![CDATA[sparc]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1187</guid>
		<description><![CDATA[I have finally got my hands on some SPARC gear, and I am making use of it by documenting the crap out of it.  So after I got the ILOM situation sorted out I noticed that the OS itself wasn&#8217;t starting up, and I was just ending up at a prompt that looks like this. [...]]]></description>
				<content:encoded><![CDATA[<p>I have finally got my hands on some SPARC gear, and I am making use of it by documenting the crap out of it.  So after I got the ILOM situation sorted out I noticed that the OS itself wasn&#8217;t starting up, and I was just ending up at a prompt that looks like this.</p>
<pre class="brush: plain; title: ; notranslate">{0} ok</pre>
<p>This is the OK Prompt, some systems will display ok&gt; and this is how I will refer to it in subsequent examples.  So lets dig in.</p>
<p><strong>What is OpenBoot PROM?</strong></p>
<p>The OpenBoot PROM (OK Prompt) is a boot monitor which allows us to interact with the boot environment, we can use it to pass different boot parameters.  We can use it to select a boot device, boot into various modes (verbose, single user, reconfigure).  There is much more to it then this, look up Open Firmware for more information.</p>
<p><strong>Why am I Stuck at the OK Prompt?</strong></p>
<p>Now in my situation, the system was not even attempting booting up.  That is because on this particular system auto_boot was disabled.  This can be seen by printing the environment&#8230;</p>
<pre class="brush: plain; title: ; notranslate">ok&gt; printenv
Variable Name           Value                          Default Value

...
auto-boot?              false                          true
...</pre>
<p>Now in my case that is fine.  I don&#8217;t want this to boot automatically, but I still need to boot it, but before we do lets check our boot order.</p>
<p><strong>Configuring Boot Devices</strong></p>
<pre class="brush: plain; title: ; notranslate">ok&gt; printenv boot-device
boot-device =           disk net</pre>
<p>We can change this easily enough if it is incorrect.  For example if we wanted to add a cdrom, but after the disk.</p>
<pre class="brush: plain; title: ; notranslate">ok&gt; setenv boot-device disk cdrom net</pre>
<pre class="brush: plain; title: ; notranslate">ok&gt; printenv boot-device
boot-device =           disk cdrom net</pre>
<p>But I don&#8217;t want to have a cdrom as part of the boot order, so instead I would rather boot up the device as an override.</p>
<p><strong>Manually Select a Boot Device</strong></p>
<pre class="brush: plain; title: ; notranslate">ok&gt; boot cdrom</pre>
<p>This can also be done against any other device which is bootable, for example another disk.  But first lets find out what exactly we have for disks.</p>
<p><strong>View Disks</strong></p>
<pre class="brush: plain; title: ; notranslate">ok&gt; show-disks
a) /pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2/hub@2/hub@3/storage@2/disk
b) /pci@400/pci@2/pci@0/pci@4/scsi@0/disk
c) /pci@400/pci@1/pci@0/pci@4/scsi@0/disk
d) /iscsi-hba/disk
q) NO SELECTION
Enter Selection, q to quit: q</pre>
<p>So we can see here we have 2 disks:</p>
<p>/pci@400/pci@1/pci@0/pci@4/scsi@0/disk<br />
/pci@400/pci@2/pci@0/pci@4/scsi@0/disk</p>
<p>Now with this information, we still haven&#8217;t made the connection between our boot-device which is &#8220;disk cdrom net&#8221; in order to define these names we need to look at devalias.</p>
<p><strong>Just Call me Disk.  A Lesson in aliases.</strong></p>
<p>Devalias allows us to define names for our devices, which can be more easily referred to.  Below is trimmed for brevity.</p>
<pre class="brush: plain; title: ; notranslate">ok&gt; devalias
...
net0                     /pci@400/pci@2/pci@0/pci@6/network@0
net                      /pci@400/pci@2/pci@0/pci@6/network@0
...
disk4                    /pci@400/pci@2/pci@0/pci@4/scsi@0/disk@p0
cdrom                    /pci@400/pci@2/pci@0/pci@4/scsi@0/disk@p6
...
disk0                    /pci@400/pci@1/pci@0/pci@4/scsi@0/disk@p0
disk                     /pci@400/pci@1/pci@0/pci@4/scsi@0/disk@p0
...</pre>
<p>Now when we look at this output we notice a few things.</p>
<p>1) @p0 on disks &#8211; I believe this refers to partitions on the disk.  p0 being the whole disk.<br />
2) Multiple aliases to the same underlying device, case in point disk and disk0 as well as net and net0.</p>
<p>So we can create aliases to denote a primary and a mirror disk on our two disks.</p>
<pre class="brush: plain; title: ; notranslate">ok&gt; devalias primary /pci@400/pci@1/pci@0/pci@4/scsi@0/disk@p0
ok&gt; devalias mirror /pci@400/pci@2/pci@0/pci@4/scsi@0/disk@p0
ok&gt; devalias
mirror                   /pci@400/pci@2/pci@0/pci@4/scsi@0/disk@p0
primary                  /pci@400/pci@1/pci@0/pci@4/scsi@0/disk@p0
...</pre>
<p>Important to note that when you create an alias using devalias it doesn&#8217;t get committed, and will disappear after a reboot&#8230;  If you need a persistent alias, use nvalias.</p>
<pre class="brush: plain; title: ; notranslate">ok&gt; nvalias primary /pci@400/pci@1/pci@0/pci@4/scsi@0/disk@p0
ok&gt; nvalias mirror /pci@400/pci@1/pci@0/pci@4/scsi@0/disk@p0</pre>
<p>Then of course we can change our boot-device to reflect this.</p>
<pre class="brush: plain; title: ; notranslate">ok&gt; setenv boot-device primary mirror</pre>
<p>Now at some point you might need to remove an alias.</p>
<pre class="brush: plain; title: ; notranslate">ok&gt; nvunalias mirror
nvunalias primary</pre>
<p>To finalize the removal, we need to reset the machine.</p>
<pre class="brush: plain; title: ; notranslate">ok&gt; reset-all</pre>
<p>There is much more to the OK prompt, but this ought to get you started.  Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/08/solaris-11-on-sparc-what-the-piss-is-the-ok-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris 11: Permit Root Logins Locally and via SSH</title>
		<link>http://blog.allanglesit.com/2012/07/solaris-11-permit-root-logins-locally-and-via-ssh/</link>
		<comments>http://blog.allanglesit.com/2012/07/solaris-11-permit-root-logins-locally-and-via-ssh/#comments</comments>
		<pubDate>Tue, 31 Jul 2012 11:00:58 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[solaris11]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1185</guid>
		<description><![CDATA[In Solaris 11, a secondary user is created as part of the installation process, the text installation allows you to bypass this, but even if you do you will be unable to login as root to perform any configurations, even though you set the password as part of the setup.  Now if you went through [...]]]></description>
				<content:encoded><![CDATA[<p>In Solaris 11, a secondary user is created as part of the installation process, the text installation allows you to bypass this, but even if you do you will be unable to login as root to perform any configurations, even though you set the password as part of the setup.  Now if you went through this in the installation, you can salvage your installation by booting into single user mode.  But for those of us who just want to manage this box differently the steps are the same (minus the single user mode).</p>
<p><strong>Configure SSH to Permit Root Logins</strong></p>
<pre class="brush: plain; title: ; notranslate"># vi /etc/ssh/sshd_config</pre>
<p>Here we want to find &#8220;PermitRootLogin&#8221; and flip it to yes.</p>
<pre class="brush: plain; title: ; notranslate"># svcadm restart ssh</pre>
<p>Then restart SSH.  SSH will now accept root as a login account, however root is still set as a role.</p>
<pre class="brush: plain; title: ; notranslate"># vi /etc/user_attr</pre>
<p>Here we want to find the line which is for the user root, and remove the last portion of the line which says &#8220;type=role&#8221;.</p>
<p>That is it.  You can now login directly on the console or via SSH using the root account and password you set during installation.  Of course you can reset the password using passwd as well if need be.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/07/solaris-11-permit-root-logins-locally-and-via-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux-KVM: Using KVM on Oracle Linux 6</title>
		<link>http://blog.allanglesit.com/2012/06/linux-kvm-using-kvm-on-oracle-linux-6/</link>
		<comments>http://blog.allanglesit.com/2012/06/linux-kvm-using-kvm-on-oracle-linux-6/#comments</comments>
		<pubDate>Mon, 11 Jun 2012 11:00:29 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux-KVM]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oel]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1162</guid>
		<description><![CDATA[In my new role I am using Oracle Linux more and more, so as an exercise I have been replicating my builds on Oracle Linux.  Here we are going to use Oracle Linux 6.2 x86_64 as a KVM hypervisor.  Keep in mind that KVM is not Oracle&#8217;s preferred hypervisor, however it is supported, but if [...]]]></description>
				<content:encoded><![CDATA[<p>In my new role I am using Oracle Linux more and more, so as an exercise I have been replicating my builds on Oracle Linux.  Here we are going to use Oracle Linux 6.2 x86_64 as a KVM hypervisor.  Keep in mind that KVM is not Oracle&#8217;s preferred hypervisor, however it is supported, but if you plan on taking advantage of the reduced software licensing cost by limiting your cores for Oracle Products you will need to use Oracle VM, which is built on Xen not KVM.  Read on to find out how to configure Oracle Linux as a KVM hypervisor.</p>
<p><strong>Configure Oracle Linux Repositories</strong></p>
<p>You can use Oracle&#8217;s Public Yum server.  This provides free software updates and a package source for Oracle Linux.  Keep in mind, these updates do not require a support contract and thus do not come with any support.  If you need support you can buy it from the Oracle Store.</p>
<pre class="brush: plain; title: ; notranslate"># cd /etc/yum.repos.d/
# wget http://public-yum.oracle.com/public-yum-ol6.repo</pre>
<p><strong>Install Latest Updates</strong></p>
<p>I installed all of the latest updates, it came out to be around 120 updates.  And it brought me up to the RHEL-Compatible Kernel 2.6.32-220.17.1.el6 and UEK 2.6.32-300.25.1.el6uek.</p>
<pre class="brush: plain; title: ; notranslate">#yum update</pre>
<p><strong>Configure Ethernet Bridge</strong></p>
<pre class="brush: plain; title: ; notranslate"># cat ifcfg-br0
DEVICE=br0
TYPE=Bridge
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=dhcp</pre>
<pre class="brush: plain; title: ; notranslate"># cat ifcfg-eth1
DEVICE=eth1
NM_CONTROLLED=no
ONBOOT=yes
BRIDGE=br0</pre>
<pre class="brush: plain; title: ; notranslate"># /etc/init.d/network restart
Shutting down interface eth1:  bridge br0 does not exist!
[  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth1:                                [  OK  ]
Bringing up interface br0:
Determining IP information for br0... done.
[  OK  ]</pre>
<p><strong>Install Required Software</strong></p>
<p>The only things we really have to install is kvm, and libvirt if you want to use libvirt to manage it.</p>
<pre class="brush: plain; title: ; notranslate"># yum install kvm libvirt</pre>
<p>I also include the following software in my KVM builds as they add a lot of flexibility (vim and pv are not even hypervisor related but I use them extensively to edit xml and move disk images).</p>
<pre class="brush: plain; title: ; notranslate"># yum install python-virtinst virt-top virt-manager virt-v2v virt-viewer vim pv</pre>
<p>Once you have performed the install everything required for KVM is ready to go.  Next we need to define a VM, this can be done with virt-manager.  Or by using one of my previously documented methods.</p>
<p><a href="http://blog.allanglesit.com/2011/03/kvm-guests-manipulating-libvirt-xml-for-guest-creation/">http://blog.allanglesit.com/2011/03/kvm-guests-manipulating-libvirt-xml-for-guest-creation/</a></p>
<p><a href="http://blog.allanglesit.com/2011/03/kvm-guests-using-virt-install-to-install-vms-from-a-cd-or-iso-imag/">http://blog.allanglesit.com/2011/03/kvm-guests-using-virt-install-to-install-vms-from-a-cd-or-iso-imag/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/06/linux-kvm-using-kvm-on-oracle-linux-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade Solaris 11 Express to Solaris 11</title>
		<link>http://blog.allanglesit.com/2012/05/upgrade-solaris-11-express-to-solaris-11/</link>
		<comments>http://blog.allanglesit.com/2012/05/upgrade-solaris-11-express-to-solaris-11/#comments</comments>
		<pubDate>Wed, 30 May 2012 11:00:54 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[ips]]></category>
		<category><![CDATA[pkg]]></category>
		<category><![CDATA[solaris11]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1155</guid>
		<description><![CDATA[Check Current Version The important thing to notice here is snv_151a, which means that it is Solaris 11 Express. &#160; Display the Current IPS Repositories This will show you the repositories configured on your system. Configure the IPS Repository If you don&#8217;t already have the repository configured you will need to configure it. Update Packages [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Check Current Version</strong></p>
<p>The important thing to notice here is snv_151a, which means that it is Solaris 11 Express.</p>
<pre class="brush: plain; title: ; notranslate"># uname -a
SunOS storage01 5.11 snv_151a i86pc i386 i86pc Solaris</pre>
<pre class="brush: plain; title: ; notranslate"># cat /etc/release
Oracle Solaris 11 Express snv_151a X86
Copyright (c) 2010, Oracle and/or its affiliates.  All rights reserved.
Assembled 04 November 2010</pre>
<p>&nbsp;</p>
<p><strong>Display the Current IPS Repositories</strong></p>
<p>This will show you the repositories configured on your system.</p>
<pre class="brush: plain; title: ; notranslate"># pkg publisher
PUBLISHER                             TYPE     STATUS   URI
solaris                               origin   online   http://pkg.oracle.com/solaris/release/</pre>
<p><strong>Configure the IPS Repository</strong></p>
<p>If you don&#8217;t already have the repository configured you will need to configure it.</p>
<pre class="brush: plain; title: ; notranslate"># pkg set-publisher -g http://pkg.oracle.com/solaris/release solaris</pre>
<p><strong>Update Packages</strong></p>
<pre class="brush: plain; title: ; notranslate"># pkg update
WARNING: pkg(5) appears to be out of date, and should be updated before
running update.  Please update pkg(5) using 'pfexec pkg install
pkg:/package/pkg' and then retry the update.</pre>
<p>As it mentions we need to install the updated version of pkg to preceed with update installation.</p>
<pre class="brush: plain; title: ; notranslate"># pkg install pkg
Packages to update:     5
Create boot environment:   Yes
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  5/5     485/485      3.5/3.5

PHASE                                        ACTIONS
Removal Phase                                   1/58
Warning - directory /tmp/tmpw15nh0/usr/share/man/cat1m not empty or not expected during operation - contents preserved in /tmp/tmpw15nh0/var/pkg/lost+found/usr/share/man/cat1m-20120528T202140Z
Removal Phase                                  58/58
Install Phase                                199/199
Update Phase                                 465/465

PHASE                                          ITEMS
Package State Update Phase                     10/10
Package Cache Update Phase                       5/5
Image State Update Phase                         2/2

A clone of solaris exists and has been updated and activated.
On the next boot the Boot Environment solaris-1 will be mounted on '/'.
Reboot when ready to switch to this updated BE.</pre>
<p>Now we need to reboot into the new boot environment.</p>
<pre class="brush: plain; title: ; notranslate"># reboot</pre>
<p>Now lets run our updates.</p>
<pre class="brush: plain; title: ; notranslate"># pkg update
Packages to remove: 272
Packages to install: 207
Packages to update: 577
Create boot environment: Yes
Create backup boot environment:  No

DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                              1056/1056 68642/68642 1042.2/1042.2

PHASE                                        ACTIONS
Removal Phase                            29017/29017
Install Phase                            72725/72725
Update Phase                             72453/72453

PHASE                                          ITEMS
Package State Update Phase                 1633/1633
Package Cache Update Phase                   849/849
Image State Update Phase                         2/2

A clone of solaris-1 exists and has been updated and activated.
On the next boot the Boot Environment solaris-2 will be
mounted on '/'.  Reboot when ready to switch to this updated BE.

The following unexpected or editable files and directories were
salvaged while executing the requested package operation; they
have been moved to the displayed location in the image:

var/saf -&amp;gt; /tmp/tmpe27V3b/var/pkg/lost+found/var/saf-20120528T233642Z
var/sadm/system/logs -&amp;gt; /tmp/tmpe27V3b/var/pkg/lost+found/var/sadm/system/logs-20120528T233642Z
var/run -&amp;gt; /tmp/tmpe27V3b/var/pkg/lost+found/var/run-20120528T233642Z
etc/saf/zsmon -&amp;gt; /tmp/tmpe27V3b/var/pkg/lost+found/etc/saf/zsmon-20120528T233642Z
etc/saf -&amp;gt; /tmp/tmpe27V3b/var/pkg/lost+found/etc/saf-20120528T233642Z

---------------------------------------------------------------------------
NOTE: Please review release notes posted at:

http://www.oracle.com/pls/topic/lookup?ctx=E23824&amp;id=SERNS

---------------------------------------------------------------------------</pre>
<p>Another reboot to get into the new boot environment.</p>
<pre class="brush: plain; title: ; notranslate"># reboot</pre>
<p><strong>Check Current Version</strong></p>
<p>The &#8220;11.0&#8243; is what we are looking for.  You are now on the release version Solaris 11.</p>
<pre class="brush: plain; title: ; notranslate"># uname -a
SunOS storage01 5.11 11.0 i86pc i386 i86pc Solaris</pre>
<pre class="brush: plain; title: ; notranslate"># cat /etc/release
Oracle Solaris 11 11/11 X86
Copyright (c) 1983, 2011, Oracle and/or its affiliates.  All rights reserved.
Assembled 18 October 2011</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/05/upgrade-solaris-11-express-to-solaris-11/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bash: Programmatically Add Entries in fstab</title>
		<link>http://blog.allanglesit.com/2012/05/bash-programmatically-add-entries-in-fstab/</link>
		<comments>http://blog.allanglesit.com/2012/05/bash-programmatically-add-entries-in-fstab/#comments</comments>
		<pubDate>Tue, 29 May 2012 11:00:29 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[echo]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1110</guid>
		<description><![CDATA[So I have found that it is rather easy to add entries into /etc/fstab while maintaining relatively legible scripts and making the changes with minimal user interaction&#8230; METHOD ONE This option is the simplest, we simply echo the line into the file as we want it to appear, then based on the &#62;&#62; it is [...]]]></description>
				<content:encoded><![CDATA[<p>So I have found that it is rather easy to add entries into /etc/fstab while maintaining relatively legible scripts and making the changes with minimal user interaction&#8230;</p>
<p><strong>METHOD ONE</strong></p>
<p>This option is the simplest, we simply echo the line into the file as we want it to appear, then based on the &gt;&gt; it is added as the last line in the file.  This is fine, however this does not provide us with a way of inserting tabs, it is simply whitespace.</p>
<pre class="brush: plain; title: ; notranslate">echo &quot;nfsserver.allanglesit.com:/nfsshare      /mnt/nfs nfs rw,bg,hard,nointr,rsize=131072,wsize=131072,tcp,vers=3&quot; &gt;&gt; /etc/fstab</pre>
<p><strong>METHOD TWO</strong></p>
<p>Here we are incorporating the \t special character which is representative of the [tab] key.  With this method we must call echo with the -e parameter which tells it that we plan on adding in special characters and we want echo to translate them instead of treating them as text.  This method has a huge problem&#8230;  It is completely unreadable.</p>
<pre class="brush: plain; title: ; notranslate">echo -e &quot;nfsserver.allanglesit.com:/nfsshare\t/mnt/nfs\tnfs\trw,bg,hard,nointr,rsize=131072,wsize=131072,tcp,vers=3&quot; &gt;&gt; /etc/fstab</pre>
<p><strong>METHOD THREE</strong></p>
<p>This is the best of both worlds.  The functionality is there, but we are achieving it with a little more effort, which results in some cleaner code.  And to make it even more legible we can add comments after each line to indicate what each line is doing, as I have done with each tab line.  Another thing to notice, is that we are calling echo with -n to prevent it from creating the standard newline at the end of the entry.  This will allow us to keep pumping data onto the same line.  However we want to not call the -n on the last entry on the line.  Otherwise we will add more data to this same line if we do subsequent redirects into the same file.</p>
<pre class="brush: plain; title: ; notranslate">echo -n &quot;nfsserver.allanglesit.com:/nfsshare&quot; &gt;&gt; /etc/fstab
echo -e -n &quot;\t&quot; &gt;&gt; /etc/fstab    #INSERT TAB
echo -n &quot;/mnt/nfs&quot; &gt;&gt; /etc/fstab
echo -e -n &quot;\t&quot; &gt;&gt; /etc/fstab    #INSERT TAB
echo -n &quot;nfs&quot; &gt;&gt; /etc/fstab
echo -e -n &quot;\t&quot; &gt;&gt; /etc/fstab    #INSERT TAB
echo &quot;rw,bg,hard,nointr,rsize=131072,wsize=131072,tcp,vers=3&quot; &gt;&gt; /etc/fstab</pre>
<p>Of course any of these methods can be adapted in whatever way you need to fit your use case, this isn&#8217;t only helpful for /etc/fstab.  That is just what I was using it for.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/05/bash-programmatically-add-entries-in-fstab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LVM: Using 2TB Volumes for Volume Groups</title>
		<link>http://blog.allanglesit.com/2012/05/lvm-using-2tb-volumes-for-volume-groups/</link>
		<comments>http://blog.allanglesit.com/2012/05/lvm-using-2tb-volumes-for-volume-groups/#comments</comments>
		<pubDate>Mon, 28 May 2012 11:00:42 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[LVM2]]></category>
		<category><![CDATA[gpt]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[parted]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1093</guid>
		<description><![CDATA[Occasionally you will have the need to use physical volumes which exceed the limits of the standard DOS partitioning scheme.  When you run into this a quick fdisk -l will reveal that you will need a new way to partition your disks. Fdisk will produce output similar to this&#8230; Use Parted to Create a Partition [...]]]></description>
				<content:encoded><![CDATA[<p>Occasionally you will have the need to use physical volumes which exceed the limits of the standard DOS partitioning scheme.  When you run into this a quick fdisk -l will reveal that you will need a new way to partition your disks.</p>
<p>Fdisk will produce output similar to this&#8230;</p>
<pre class="brush: plain; title: ; notranslate">WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


WARNING: The size of this disk is 2.3 TB (2290828181504 bytes).
DOS partition table format can not be used on drives for volumes
larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID
partition table format (GPT).</pre>
<p><strong>Use Parted to Create a Partition Using the Whole Disk</strong></p>
<p>Parted is able to handle large volumes which are not able to be modified with fdisk.  Here we are going to launch parted, and then create the partition with a size of 1 -1 which means that it will use it all until it gets to the end.  You can additionally specify the number in megabytes, so 1 1024 would start at 1 and go until 1024 giving you a 1GB partition.</p>
<pre class="brush: plain; title: ; notranslate"># parted /dev/sdb
(parted) mkpart primary ext3 1 -1</pre>
<p>Review the created partition.</p>
<pre class="brush: plain; title: ; notranslate">(parted) print

Model: DELL PERC H700 (scsi)
Disk /dev/sdb: 2291GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
1      17.4kB  2291GB  2291GB               primary       </pre>
<p>Set the LVM flag.</p>
<pre class="brush: plain; title: ; notranslate">(parted) set 1 lvm on    </pre>
<p>Review our changes to our partition.</p>
<pre class="brush: plain; title: ; notranslate">(parted) print

Model: DELL PERC H700 (scsi)
Disk /dev/sdb: 2291GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
1      17.4kB  2291GB  2291GB               primary  lvm
(parted) quit</pre>
<p><strong>Initialize the Physical Volume for LVM</strong></p>
<p>The rest of this is pretty standard, and already covered in my article <a title="Linux LVM2: Flexible Local Storage Management" href="http://blog.allanglesit.com/2011/03/linux-lvm2-flexible-local-storage-management/">Linux LVM2: Flexible Local Storage Management</a> in case you&#8217;d like more details.</p>
<pre class="brush: plain; title: ; notranslate"># pvcreate /dev/sdb1
Physical volume &quot;/dev/sdb1&quot; successfully created</pre>
<p><strong>Create the LVM Volume Group</strong></p>
<pre class="brush: plain; title: ; notranslate"># vgcreate VolGroup01 /dev/sdb1
Volume group &quot;VolGroup01&quot; successfully created
# vgs
VG         #PV #LV #SN Attr   VSize  VFree
VolGroup00   1   2   0 wz--n- 99.88G    0
VolGroup01   1   0   0 wz--n-  2.08T 2.08T</pre>
<p>Well now we have a Volume Group (VolGroup01) which can be used to create Logical Volumes from.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/05/lvm-using-2tb-volumes-for-volume-groups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris 11: DNS Client Configuration Using Svccfg</title>
		<link>http://blog.allanglesit.com/2012/05/solaris-11-dns-client-configuration-using-svccfg/</link>
		<comments>http://blog.allanglesit.com/2012/05/solaris-11-dns-client-configuration-using-svccfg/#comments</comments>
		<pubDate>Wed, 23 May 2012 11:00:29 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[solaris11]]></category>
		<category><![CDATA[svccfg]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1143</guid>
		<description><![CDATA[In Solaris 11, alot of configurations are being moved from configuration files into the Service Management Framework.  Here we will discuss this change around the DNS client. View Existing DNS Client Configuration Update Existing DNS Client Configuration Here we will update our name servers.  In this case we are replacing the original with two different [...]]]></description>
				<content:encoded><![CDATA[<p>In Solaris 11, alot of configurations are being moved from configuration files into the Service Management Framework.  Here we will discuss this change around the DNS client.</p>
<p><strong>View Existing DNS Client Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s network/dns/client listprop config
config                      application
config/value_authorization astring     solaris.smf.value.name-service.dns.client
config/domain              astring     test.local
config/nameserver          net_address 10.0.0.152</pre>
<p><strong>Update Existing DNS Client Configuration</strong></p>
<p>Here we will update our name servers.  In this case we are replacing the original with two different addresses.</p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s network/dns/client setprop config/nameserver = net_address: &quot;(10.0.0.141 10.0.0.142)&quot;</pre>
<p>Here we are changing the domain to b.test.local.</p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s network/dns/client setprop config/domain = astring: b.test.local</pre>
<p>And we are defining a previously undefined setting for the search domains, we are including test.local and b.test.local.</p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s network/dns/client setprop config/search = astring: '(&quot;test.local&quot; &quot;b.test.local&quot;)'</pre>
<p>Here we are defining our name resolution order.</p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s name-service/switch setprop config/ipnodes = astring: '(&quot;files dns&quot;)'
# svccfg -s name-service/switch setprop config/host = astring: '(&quot;files dns&quot;)'</pre>
<p><strong>Review Changed DNS Client Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s network/dns/client listprop config
config                      application
config/value_authorization astring     solaris.smf.value.name-service.dns.client
config/domain              astring     b.test.local
config/nameserver          net_address 10.0.0.141 10.0.0.142
config/search              astring     &quot;test.local&quot; &quot;b.test.local&quot;</pre>
<p><strong>Review Changed Name Service Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s name-service/switch listprop config
config                      application
config/default             astring     files
config/value_authorization astring     solaris.smf.value.name-service.switch
config/printer             astring     &quot;user files&quot;
config/ipnodes             astring     &quot;files dns&quot;
config/host                astring     &quot;files dns&quot;</pre>
<p><strong>Export DNS Client Configuration</strong></p>
<p>This command will build an /etc/resolv.conf based on your settings above.</p>
<pre class="brush: plain; title: ; notranslate"># svcadm enable dns/client
# nscfg export svc:/network/dns/client:default</pre>
<pre class="brush: plain; title: ; notranslate"># cat /etc/resolv.conf

#
# Copyright (c) 2012, Oracle and/or its affiliates.  All rights reserved.
#

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#     DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See resolv.conf(4) for details.

domain  b.test.local
search  test.local b.test.local
nameserver  10.0.0.141
nameserver  10.0.0.142</pre>
<p>If you manually edit the /etc/resolv.conf then your changes will be lost on a restart of the network/dns/client service or a reboot, as the warning says.</p>
<p><strong>Export Name Service Configurations</strong></p>
<pre class="brush: plain; title: ; notranslate"># svcadm refresh name-service/switch</pre>
<pre class="brush: plain; title: ; notranslate"># cat /etc/nsswitch.conf

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See nsswitch.conf(4) for details.

passwd: files
group:  files
hosts:  files dns
ipnodes:        files dns
networks:       files
protocols:      files
rpc:    files
ethers: files
netmasks:       files
bootparams:     files
publickey:      files
netgroup:       files
automount:      files
aliases:        files
services:       files
printers:       user files
project:        files
auth_attr:      files
prof_attr:      files
tnrhtp: files
tnrhdb: files
sudoers:        files</pre>
<p><strong>An Extra Trick</strong></p>
<p>Now if you can&#8217;t be bothered to do things the new way they also put in an import mechanism, whereby you can take advantage of your existing knowledge and simply import your modified configuration files into the SMF to manage them going forward.</p>
<p>So modify up your /etc/resolv.conf and your /etc/nsswitch.conf and then import them with nscfg.</p>
<pre class="brush: plain; title: ; notranslate"># nscfg import -f name-service/switch:default
# nscfg import -f dns/client:default</pre>
<p><strong>UPDATE</strong><br />
December 30, 2012</p>
<p>I have modifed my commands above to account for the mistakes that noxxsan and Mikel brought forth in the comments.  Sorry for the delay.  I additionally added the import trick.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/05/solaris-11-dns-client-configuration-using-svccfg/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Solaris 11: Change Hostname Using Svccfg</title>
		<link>http://blog.allanglesit.com/2012/05/solaris-11-change-hostname-using-svccfg/</link>
		<comments>http://blog.allanglesit.com/2012/05/solaris-11-change-hostname-using-svccfg/#comments</comments>
		<pubDate>Tue, 22 May 2012 11:00:52 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[solaris11]]></category>
		<category><![CDATA[svccfg]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1137</guid>
		<description><![CDATA[When Solaris 11 was released more configurations were moved into the service management framework, and moved out of configuration files, one of these changes was the hostname/nodename. View Hostname in SMF This will read back the configuration out of the SMF. Change Hostname in SMF We have two separate settings, which need to be updated. [...]]]></description>
				<content:encoded><![CDATA[<p>When Solaris 11 was released more configurations were moved into the service management framework, and moved out of configuration files, one of these changes was the hostname/nodename.</p>
<p><strong>View Hostname in SMF<br />
</strong></p>
<p>This will read back the configuration out of the SMF.</p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s system/identity:node listprop config
config           application
config/nodename astring     solaris11box
config/loopback astring     solaris11box</pre>
<p><strong>Change Hostname in SMF</strong></p>
<p>We have two separate settings, which need to be updated.</p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s system/identity:node setprop config/nodename = astring: newname
# svccfg -s system/identity:node setprop config/loopback = astring: newname</pre>
<p><strong>Review the Changes</strong></p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s system/identity:node listprop config
config           application
config/nodename astring     newname
config/loopback astring     newname</pre>
<p><strong>Restart the Service to Reflect Changes</strong></p>
<p>The system is now aware of the change, however it doesn&#8217;t use the change until the next reboot.  We can accelerate this by restarting the system/identity:node service.</p>
<pre class="brush: plain; title: ; notranslate"># svccfg -s system/identity:node refresh
# svcadm restart system/identity:node</pre>
<p>This will then show a system message reflecting the new hostname, to see the change in your shell prompt, you can spin off a child bash shell.  You can also use the hostname command to view the current hostname.</p>
<p><strong>UPDATE</strong>December 30, 2012</p>
<p>Included an update based on Mark&#8217;s comment below to account for the refresh which needs to take place.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/05/solaris-11-change-hostname-using-svccfg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solaris Virtualization: Using Zones</title>
		<link>http://blog.allanglesit.com/2012/05/solaris-virtualization-using-zones/</link>
		<comments>http://blog.allanglesit.com/2012/05/solaris-virtualization-using-zones/#comments</comments>
		<pubDate>Mon, 21 May 2012 11:00:25 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris Zones]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[solaris11]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[zones]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1113</guid>
		<description><![CDATA[Solaris has the ability to do two types of Virtualization, if you are using SPARC hardware you can use Logical Domains, which has been re-branded as Oracle VM for SPARC.  Or regardless of your architecture you can use Solaris Zones, which is really much more like Linux-VServer, OpenVZ, and Linux Containers (LXC) than a &#8220;full&#8221; [...]]]></description>
				<content:encoded><![CDATA[<p>Solaris has the ability to do two types of Virtualization, if you are using SPARC hardware you can use Logical Domains, which has been re-branded as Oracle VM for SPARC.  Or regardless of your architecture you can use Solaris Zones, which is really much more like Linux-VServer, OpenVZ, and Linux Containers (LXC) than a &#8220;full&#8221; hypervisor solution.  Essentially you create a section of the file system on the host (in the case of ZFS a separate file system) and this is used by the &#8220;Zone&#8221; as the &#8220;root&#8221; or / and that is as far as the guest system can go.  This is a very fast form of virtualization because it doesn&#8217;t really virtualize anything.</p>
<p>In this article I will be going over fairly vanilla configurations of zones.  I will not be going into branded zones, which will allow you to run a different operating environment from the global zone.  This article will be large enough to not need the additional complexity of those tasks.  I will however have follow up articles as time permits, which will take deeper dives into this aspect of Solaris.</p>
<p><strong>List Zones</strong></p>
<p>By default we will only list running zones, also it is important to note that, a standard installation creates a &#8220;global&#8221; zone, this is the operating system that you are used to interacting with, all others are considered &#8220;non-global&#8221; zones (or just zones).  The key thing to remember is that all non-global zones are part of the global zone, but the reverse is not true.</p>
<pre class="brush: plain; title: ; notranslate"># zoneadm list</pre>
<p>We can also use the following parameter to list only installed zones.</p>
<pre class="brush: plain; title: ; notranslate"># zoneadm list -i</pre>
<p>The final state that they can be in is configured, this means that the configuration exists but they may not be installed yet.  This is the fullest list of zones.</p>
<pre class="brush: plain; title: ; notranslate"># zoneadm list -c</pre>
<p>Any of the above lists can be passed with a verbose parameter, this will give us the ID, Name, Status, Path, Brand, and IP.</p>
<pre class="brush: plain; title: ; notranslate"># zoneadm list -v</pre>
<p><strong>List Specific Zone Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate"># zonecfg -z testzone info</pre>
<p><strong>Zone Configuration</strong></p>
<p>Here is a quick and dirty way to configure a new zone.</p>
<pre class="brush: plain; title: ; notranslate"># zonecfg -z zone001 &quot;create;set zonepath=/export/zones/zone001&quot;</pre>
<p>For more complex configurations you will need to enter the zonecfg prompt.</p>
<pre class="brush: plain; title: ; notranslate"># zonecfg -z zone001
zone001: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone001&gt; create
create: Using system default template 'SYSdefault'
zonecfg:zone001&gt; set zonepath=/export/zones/zone001
zonecfg:zone001&gt; add attr
zonecfg:zone001:attr&gt; set name=comment
zonecfg:zone001:attr&gt; set type=string
zonecfg:zone001:attr&gt; set value=&quot;this is a comment&quot;
zonecfg:zone001:attr&gt; end
zonecfg:zone001&gt; add net
zonecfg:zone001:net&gt; set physical=zone001vnic0
zonecfg:zone001:net&gt; end
zonecfg:zone001&gt; add dataset
zonecfg:zone001:dataset&gt; set name=rpool/zonedata
zonecfg:zone001:dataset&gt; end
zonecfg:zone001&gt; verify
zonecfg:zone001&gt; commit
zonecfg:zone001&gt; exit</pre>
<p>At the end we performed a verify to look for any problems with out configuration.  If we for example forgot to define a zonepath, then we would receive a notice similar to this&#8230;</p>
<pre class="brush: plain; title: ; notranslate"> zonepath cannot be empty.
zone001: Required resource missing</pre>
<p>This can be resolved by providing the missing zonepath.</p>
<p><strong>Create Zone Dataset</strong></p>
<p>The install process will create the ZFS dataset for the zonepath, however since we have defined an additional dataset then we must pre-create that dataset.</p>
<pre class="brush: plain; title: ; notranslate"># zfs create rpool/zonedata</pre>
<p><strong>Create Virtual Networking Card</strong></p>
<p>Solaris 11 using exclusive networking by default, meaning, one zone per device.  This allows you to limit traffic to a particular zone.  Additionally there is a shared-type which you will assign the zone to use the physical network card.  When using the exclusive method we must create a vnic.</p>
<pre class="brush: plain; title: ; notranslate"># dladm create-vnic -l net0 zone001vnic0</pre>
<p><strong>Installation of a Zone<br />
</strong></p>
<p>When doing a default install it will use the IPS repositories from the host, so make sure that your host connectivity is worked out.</p>
<pre class="brush: plain; title: ; notranslate"># zoneadm -z zone001 install
Progress being logged to /var/log/zones/zoneadm.20120520T172618Z.zone001.install
Image: Preparing at /export/zones/zone001/root.

Install Log: /system/volatile/install.1980/install_log
AI Manifest: /tmp/manifest.xml.zuaa2d
SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
Zonename: zone001
Installation: Starting ...

Creating IPS image
Installing packages from:
solaris
origin:  http://pkg.oracle.com/solaris/release/
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                              167/167 32062/32062  175.8/175.8

PHASE                                        ACTIONS
Install Phase                            44313/44313

PHASE                                          ITEMS
Package State Update Phase                   167/167
Image State Update Phase                         2/2
Installation: Succeeded

Note: Man pages can be obtained by installing pkg:/system/manual

done.

Done: Installation completed in 668.825 seconds.

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 /export/zones/zone001/root/var/log/zones/zoneadm.20120520T172618Z.zone001.install</pre>
<p><strong>Renaming a Zone</strong></p>
<p>It is almost certain that you will at some point need to change the name of a zone.</p>
<pre class="brush: plain; title: ; notranslate">zonecfg -z testzone &quot;set zonename=newname'</pre>
<p><strong>Connect to the Console of the Zone</strong></p>
<p>On first start up after install you will want to use two shells, and connect to the console from one first, then using the other shell, boot the zone.</p>
<pre class="brush: plain; title: ; notranslate">zlogin -C zone001
[Connected to zone 'zone001' console]

[NOTICE: Zone booting up]</pre>
<p>After booting up you should see something like this&#8230;</p>
<pre class="brush: plain; title: ; notranslate">
System Configuration Tool

System Configuration Tool enables you to specify the following
configuration parameters for your newly-installed Oracle Solaris 11
system:
- network, time zone, user and root accounts, name services

System Configuration Tool produces an SMF profile file in
/system/volatile/scit_profile.xml.

How to navigate through this tool:
- Use the function keys listed at the bottom of each screen to move
from screen to screen and to perform other operations.
- Use the up/down arrow keys to change the selection or to move
between input fields.
- If your keyboard does not have function keys, or they do not
respond, press ESC; the legend at the bottom of the screen will
change to show the ESC keys for navigation and other functions.

F2_Continue  F6_Help  F9_Quit                                                </pre>
<p>Follow this through the initial setup.  I set my computer name to zone001 to match the zone name, I also set the network connection to be configured Automatically.  After the configuration is complete you should see something like this.</p>
<pre class="brush: plain; title: ; notranslate">Exiting System Configuration Tool. Log is available at:
/var/tmp/install/sysconfig.log
Hostname: zone001
zone001 console login:</pre>
<p>To disconnect we can use the ~. keystroke.  That is tilde + period.</p>
<p><strong>Start/Boot a Zone</strong></p>
<pre class="brush: plain; title: ; notranslate">zoneadm -z zone001 boot</pre>
<p><strong>Reboot a Zone</strong></p>
<pre class="brush: plain; title: ; notranslate">zoneadm -z zone001 reboot</pre>
<p><strong>Shutdown a Zone</strong></p>
<pre class="brush: plain; title: ; notranslate">zoneadm -z zone001 shutdown</pre>
<p><strong>Halt a Zone</strong></p>
<p>This is a forced power off of the zone, equivalent to a power unplug.</p>
<pre class="brush: plain; title: ; notranslate">zoneadm -z zone001 halt</pre>
<p><strong>UPDATE</strong><br />
December 30, 2012</p>
<p>One minor thing I have noticed, is that when connecting to a Solaris machine via ssh and then disconnecting from a zone console connection using the ~. (tilde and period) hot key you will actually disconnect not only from the console, but also from the SSH session on your machine.  To avoid this second disconnection and only disconnect from the zone console session instead use the ~~. (tilde and tilde and period) hot key.  This will leave your SSH session intact, and allow you to change between zone consoles.</p>
<p><strong>UPDATE</strong><br />
January 2, 2012</p>
<p>When using the method outlined in my article &#8220;SSH Hop Through Multiple Hosts&#8221; and the ~~. hot key you will find that your SSH connection is still disconnected.  For this use case simple append one more tilde.  So if you are connecting from Machine A through Machine B to Machine C, then you will need ~~~. (tilde and tilde and tilde and period) or one for each machine (including the SSH client and server.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/05/solaris-virtualization-using-zones/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle VM: Using Oracle VM Manager 3 from Ubuntu Linux</title>
		<link>http://blog.allanglesit.com/2012/05/oracle-vm-using-oracle-vm-manager-3-from-ubuntu-linux/</link>
		<comments>http://blog.allanglesit.com/2012/05/oracle-vm-using-oracle-vm-manager-3-from-ubuntu-linux/#comments</comments>
		<pubDate>Wed, 16 May 2012 11:00:34 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle VM]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracle vm]]></category>
		<category><![CDATA[ovm]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1085</guid>
		<description><![CDATA[In my initial work with Oracle VM, I have run into a few fringe cases, which are not well documented, but actually have rather simple solutions.  This one actually cropped up over the weekend for me.  Over the weekend I decided to rebuild my company-issued laptop with Ubuntu Linux (12.04 amd64) to be specific.  I [...]]]></description>
				<content:encoded><![CDATA[<p>In my initial work with Oracle VM, I have run into a few fringe cases, which are not well documented, but actually have rather simple solutions.  This one actually cropped up over the weekend for me.  Over the weekend I decided to rebuild my company-issued laptop with Ubuntu Linux (12.04 amd64) to be specific.  I did this for a number of reasons&#8230;</p>
<p>1)  I am far more effective with Linux, due to the nature of the shell, and tools which I am familiar with (vim, dd, really take your pick they are everywhere).<br />
2)  I personally prefer Ubuntu 12.04 (though they nearly lost me with some of the early iterations of Ubuntu &#8211; 12.04 has it mostly sorted), my primary reason for liking Ubuntu is because of the apt package manager.</p>
<p>But I digress.  When I jumped into this I ran into a rather serious issue for me.  I was unable to launch the console of my VMs on Oracle VM Manager (3.1.1).  Initially it seemed that all I might need was the appropriate version of a Java JRE.  Although it turned out to be a bit more complicated than that.</p>
<p><strong>Install OpenJDK 6 JRE</strong></p>
<p>This is the core of what we need to do.  Basically we are trying to launch a Java application, and without it we are unable to carry on.</p>
<pre class="brush: plain; title: ; notranslate"># apt-get install openjdk-6-jre</pre>
<p>However this gets us to a point where we can launch the Java applications, but not actually get console to our system.  For that there is another little bit of software that Oracle has, the Oracle VM Console application.</p>
<p><strong>Download Oracle VM Console Application</strong></p>
<p>Here we have a 64 bit and 32 bit rpm files, download whichever one fits your architecture.</p>
<p><a href="http://oss.oracle.com/oraclevm/manager/RPMS/ovm-console-1.0.0-2.i386.rpm">http://oss.oracle.com/oraclevm/manager/RPMS/ovm-console-1.0.0-2.i386.rpm</a></p>
<p><a href="http://oss.oracle.com/oraclevm/manager/RPMS/ovm-console-1.0.0-2.x86_64.rpm">http://oss.oracle.com/oraclevm/manager/RPMS/ovm-console-1.0.0-2.x86_64.rpm</a></p>
<p>So in my case</p>
<pre class="brush: plain; title: ; notranslate"># wget http://oss.oracle.com/oraclevm/manager/RPMS/ovm-console-1.0.0-2.x86_64.rpm</pre>
<p>Also it might be wise to check the parent directory to see if newer versions are released.</p>
<p><a href="http://oss.oracle.com/oraclevm/manager/RPMS/">http://oss.oracle.com/oraclevm/manager/RPMS/</a></p>
<p>Now of course we still have to deal with the fact that we are running Ubuntu which doesn&#8217;t know what to do with RPMs.  Enter Alien.</p>
<p><strong>Install RPM Conversion Tools</strong></p>
<p>Alien will convert a RPM into a deb file which can be used via dpkg (the underlying system to apt).  So basically we put in an .rpm and get back a .deb.  Simple enough?</p>
<pre class="brush: plain; title: ; notranslate"># apt-get install alien dpkg-dev debhelper build-essential</pre>
<p><strong>Perform Conversion and Installation</strong></p>
<p>So now we just need to feed alien our .rpm and it couldn&#8217;t be easier&#8230;</p>
<pre class="brush: plain; title: ; notranslate"># alien ovm-console-1.0.0-2.x86_64.rpm
Warning: Skipping conversion of scripts in package ovm-console: postinst
Warning: Use the --scripts parameter to include the scripts.
ovm-console_1.0.0-3_amd64.deb generated</pre>
<p>And now to install our .deb&#8230;</p>
<pre class="brush: plain; title: ; notranslate"># dpkg -i ovm-console_1.0.0-3_amd64.deb
Selecting previously unselected package ovm-console.
(Reading database ... 175033 files and directories currently installed.)
Unpacking ovm-console (from ovm-console_1.0.0-3_amd64.deb) ...
Setting up ovm-console (1.0.0-3) ...</pre>
<p>Now just try and launch the console and see what happens.</p>
<p><a href="http://blog.allanglesit.com/wp-content/uploads/2012/05/oraclevm-using-console-from-ubuntu.png"><img class="aligncenter size-medium wp-image-1086" title="oraclevm-using-console-from-ubuntu" src="http://blog.allanglesit.com/wp-content/uploads/2012/05/oraclevm-using-console-from-ubuntu-300x155.png" alt="Displaying Successful OVM Console Connection from Ubuntu 12.04" width="300" height="155" /></a></p>
<p>The same steps allowed it to work on both Firefox and Chromium.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/05/oracle-vm-using-oracle-vm-manager-3-from-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle VM 3.x: Reset Agent Password</title>
		<link>http://blog.allanglesit.com/2012/05/oracle-vm-3-x-reset-agent-password/</link>
		<comments>http://blog.allanglesit.com/2012/05/oracle-vm-3-x-reset-agent-password/#comments</comments>
		<pubDate>Tue, 15 May 2012 11:00:04 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle VM]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracle vm]]></category>
		<category><![CDATA[ovm]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1058</guid>
		<description><![CDATA[Oracle VM, is a centrally managed hypervisor.  All administrative actions must be performed from the Oracle VM Manager.  In order to facilitate the initial discovery of the Hypervisor by the Management Server part of the setup requires that we not only set the password for the root user, but also the password for the ovs-agent.  [...]]]></description>
				<content:encoded><![CDATA[<p>Oracle VM, is a centrally managed hypervisor.  All administrative actions must be performed from the Oracle VM Manager.  In order to facilitate the initial discovery of the Hypervisor by the Management Server part of the setup requires that we not only set the password for the root user, but also the password for the ovs-agent.  We then initiate a discovery process from the management server to the hypervisor and end up able to manage our hypervisor.</p>
<p>During my setup I misplaced the password for the agent.  This resulted in my management server being unable to successfully authenticate with the hypervisor in order to complete the discovery process.</p>
<p>Once you have successfully discovered the hypervisor you can change the agent password at the server pool level, which will allow you to maintain different agent passwords for different logical areas.</p>
<p>In my environment I am using OVM 3.1.1.</p>
<pre class="brush: plain; title: ; notranslate"># ovs-agent-passwd oracle
Password: &lt;yourpasshere&gt;
Again: &lt;yourpasshere&gt;</pre>
<p>After changing the password, discovery went off without a hitch, of course I could have just as easily misplaced it again, and I would have been right back at square one.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/05/oracle-vm-3-x-reset-agent-password/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing Oracle VM Manager 3.1.1</title>
		<link>http://blog.allanglesit.com/2012/05/installing-oracle-vm-manager-3-1-1/</link>
		<comments>http://blog.allanglesit.com/2012/05/installing-oracle-vm-manager-3-1-1/#comments</comments>
		<pubDate>Mon, 14 May 2012 11:00:54 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle VM]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracle vm]]></category>
		<category><![CDATA[ovm]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1057</guid>
		<description><![CDATA[In my new role at Keste, I am tasked with staying on the bleeding edge of software release cycles, so that we can be knowledgeable and authoritative about technology when we engage with customers.  One of the areas where Keste leads is on Oracle&#8217;s Virtualization Offerings.  So I will be posting more and more content [...]]]></description>
				<content:encoded><![CDATA[<p>In my new role at Keste, I am tasked with staying on the bleeding edge of software release cycles, so that we can be knowledgeable and authoritative about technology when we engage with customers.  One of the areas where Keste leads is on Oracle&#8217;s Virtualization Offerings.  So I will be posting more and more content with respect to those offerings.</p>
<p>Today I will be documenting the steps to install Oracle VM Manager 3.1.1.  Oracle VM (OVM) is a Xen-based Virtualization Technology.  An OVM Deployment consists of the OVM Server (the bare metal hypervisor) and the OVM Manager, the application stack which manages the afforementioned hypervisors (organized into Server Pools).</p>
<p>The OVM Server installation is really no different from a standard Oracle Linux, or even RHEL install, so I am not going to bother writing that one up unless something changes architecturally.</p>
<p>Now to get started I have pre-provisioned a Oracle Linux Server (5.6) machine which will accept the OVM Manager application.</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/issue
Oracle Linux Server release 5.6
Kernel \r on an \m</pre>
<p><strong>Download Media</strong></p>
<p>Download Oracle VM Manager 3.1.1 from http://edelivery.oracle.com/oraclevm</p>
<p><strong>Mount Media</strong></p>
<p>I have an NFS mount which holds my media, but the process is the same if you are using local storage.  We want to mount the iso image file into a folder (/mnt in my case)</p>
<pre class="brush: plain; title: ; notranslate"># mount -o loop /nfsmount/OracleVM-Manager-3.1.1.iso /mnt
# cd /mnt
# ls
components       EULA     oracle-validated.params  runInstaller.sh  TRANS.TBL
createOracle.sh  LICENSE  ovmm-installer.bsx       runUpgrader.sh   upgrade</pre>
<p><strong>Prepare Machine for Installation</strong></p>
<p>Oracle VM Manager includes a script which does most of the dirty work for us&#8230;  This will create the users/groups, folders, and iptables rules needed by OVM.  If you are going to be using an external firewall, then these are the ports you will need to open on your firewall (bold denotes client to management server communications &#8211; remainder are management server to hypervisor).</p>
<p>tcp: <strong>7001</strong>-<strong>7002</strong>, <strong>15901</strong>, 54321-5432</p>
<p>udp: 123</p>
<p>Luckily though all we need to do is execute the below script&#8230;</p>
<pre class="brush: plain; title: ; notranslate"># ./createOracle.sh
Adding group 'oinstall' with gid '54321' ...
Adding group 'dba'
Adding user 'oracle' with user id '54321', initial login group 'dba', supplementary group 'oinstall' and  home directory '/home/oracle' ...
Changing ownership of '/home/oracle' to oracle:dba
Creating user 'oracle' succeeded ...
Verifying user 'oracle' OS prerequisites for Oracle VM Manager ...
oracle  soft    nofile          8192
oracle  hard    nofile          8192
oracle  soft    nproc           4096
oracle  hard    nproc           4096
oracle  soft    core            unlimited
oracle  hard    core            unlimited
Setting  user 'oracle' OS limits for Oracle VM Manager ...
Altered file /etc/security/limits.conf
Original file backed up at /etc/security/limits.conf.orabackup
Verifying &amp;amp; setting of user limits succeeded ...
Modifying iptables for OVM
Adding rules to enable access to:
7001  : Oracle VM Manager http
7002  : Oracle VM Manager https
15901 : Oracle VM Manager VM console proxy
54321 : Oracle VM Manager core
54322 : Oracle VM Manager core via SSL
123 : NTP
Saving firewall rules to /etc/sysconfig/iptables:          [  OK  ]
Rules added.</pre>
<p>The documentation mentions libaio, bc, and unzip as prerequsites.  My install already included this, so installing them was redundant.</p>
<pre class="brush: plain; title: ; notranslate"># yum install libaio bc unzip
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Package libaio-0.3.106-5.x86_64 already installed and latest version
Package libaio-0.3.106-5.i386 already installed and latest version
Package bc-1.06-21.x86_64 already installed and latest version
Package unzip-5.52-3.0.1.el5.x86_64 already installed and latest version
Nothing to do.</pre>
<p><strong>Install the Oracle VM Manager Software</strong></p>
<p>Here we simply execute the installer script and follow the prompts.  Notice the first prompt asks us the installation type.  I am using Demo, this will install the XE database, and configure OVM Manager to use that.  This is not a support configuration.  If you plan on using this stack in production you will need to install using option two, which will not install a database but rather will require that you connect to a pre-created database, on either the local or a remote server.</p>
<pre class="brush: plain; title: ; notranslate"># ./runInstaller.sh

Oracle VM Manager Release 3.1.1 Installer

Oracle VM Manager Installer log file:
/tmp/install-2012-05-09-162921.log</pre>
<pre class="brush: plain; title: ; notranslate">Please select an installation type:
1: Demo
2: Production
3: Uninstall
4: Help

Select Number (1-4): 1

Starting demo installation ...</pre>
<p>Just some warnings about the XE database.  If you are installing this for production, make sure you heed this warning.</p>
<pre class="brush: plain; title: ; notranslate">The Demo installation type will use an XE database.  The usage of XE is for *demo purposes only* and is not supported for production. Please *do not* plan to start with XE and migrate to a supported version of the database as this may not be possible. For production environments or any long term usage please use the &quot;Production&quot; option with an SE or EE database.
1: Continue
2: Abort

Select Number (1-2): 1</pre>
<p>Now we are going to enter the password to be used for all purposes.  You must have a password with only alpha-numeric characters, no special characters here, you also must have both upper and lower case, with a length of 8.</p>
<pre class="brush: plain; title: ; notranslate">Verifying installation prerequisites ...

One password is used for all users created and used during the installation.
Enter a password for all logins used during the installation: &amp;lt;enter password here&amp;gt;
Enter a password for all logins used during the installation (confirm): &amp;lt;re-enter password here&amp;gt;</pre>
<p>Now that we are ready to begin, this is your last chance to back out.</p>
<pre class="brush: plain; title: ; notranslate">Verifying configuration ...

Start installing the configured components:
1: Continue
2: Abort

Select Number (1-2): 1</pre>
<p>Beginning the installation, now we just wait.</p>
<pre class="brush: plain; title: ; notranslate">Step 1 of 9 : Database ...
Installing Database ...
Retrieving Oracle Database 11g XE ...
Installing Oracle Database 11g XE ...
Configuring Oracle Database 11g XE ...

Step 2 of 9 : Java ...
Installing Java ...</pre>
<p>I ran into a problem here.  I used a password which I believe met all of the requirements, 1 upper-case, 1 number, 8 lower-case, no special characters.  However the install failed here with a failed authentication error.  I suspected this had something to do with differing password requirements for various components.  I tried re-running the installation with a 8 digit password, that met the requirements, but it was having a problem since the Database and Java were already installed.  I got around this by choosing the uninstall option when first executing the install script.  Then the subsequent run with the 8 digit-only password worked an example of a password which meets the requirements would be Gpdf5098.</p>
<pre class="brush: plain; title: ; notranslate">Step 3 of 9 : Database Schema ...
Creating database schema 'ovs' ...

Step 4 of 9 : WebLogic ...
Retrieving Oracle WebLogic Server 11g ...
Installing Oracle WebLogic Server 11g ...

Step 5 of 9 : ADF ...
Retrieving Oracle Application Development Framework (ADF) ...
Unzipping Oracle ADF ...
Installing Oracle ADF ...
Installing Oracle ADF Patch...

Step 6 of 9 : Oracle VM  ...
Retrieving Oracle VM Manager Application ...
Extracting Oracle VM Manager Application ...
Installing Oracle VM Manager Core ...

Step 7 of 9 : Domain creation ...
Creating Oracle WebLogic Server domain ...
Starting Oracle WebLogic Server 11g ...
Configuring data source 'OVMDS' ...
Creating Oracle VM Manager user 'admin' ...

Step 8 of 9 : Deploy ...
Deploying Oracle VM Manager Core container ...
Deploying Oracle VM Manager UI Console ...
Deploying Oracle VM Manager Help ...
Enabling HTTPS ...
Granting ovm-admin role to user 'admin' ...

Step 9 of 9 : Oracle VM Manager Shell ...
Retrieving Oracle VM Manager Shell &amp;amp; API ...
Extracting Oracle VM Manager Shell &amp;amp; API ...
Installing Oracle VM Manager Shell &amp;amp; API ...

Retrieving Oracle VM Manager Upgrade tool ...
Extracting Oracle VM Manager Upgrade tool ...
Installing Oracle VM Manager Upgrade tool ...
Copying Oracle VM Manager shell to '/usr/bin/ovm_shell.sh' ...
Installing ovm_admin.sh in '/u01/app/oracle/ovm-manager-3/bin' ...
Installing ovm_upgrade.sh in '/u01/app/oracle/ovm-manager-3/bin' ...
Enabling Oracle VM Manager service ...
Shutting down Oracle VM Manager instance ...
Restarting Oracle VM Manager instance ...
Waiting 15 seconds for the application to initialize ...
Oracle VM Manager is running ...
Oracle VM Manager installed.

Please wait while WebLogic configures the applications... This can take up to 5 minutes.</pre>
<p>Well the installation is nearly done.  It is doing the last step of the installation, before giving you the information you need for accessing the GUI.</p>
<pre class="brush: plain; title: ; notranslate">Installation Summary
--------------------
Database configuration:
Database host name          : localhost
Database instance name (SID): XE
Database listener port      : 1521
Application Express port    : 8080
Oracle VM Manager schema    : ovs

Weblogic Server configuration:
Administration username     : weblogic

Oracle VM Manager configuration:
Username                    : admin
Core management port        : 54321
UUID                        : 0004fb00000100004ac53f7c774415a7


Passwords:
There are no default passwords for any users. The passwords to use for Oracle VM Manager, Oracle Database 11g XE, and Oracle WebLogic Server have been set by you during this installation. In the case of a default install, all passwords are the same.</pre>
<pre class="brush: plain; title: ; notranslate">Oracle VM Manager UI:

http://ovmmgr.allanglesit.com:7001/ovm/console


https://ovmmgr.allanglesit.com:7002/ovm/console

Log in with the user 'admin', and the password you set during the installation.

Please note that you need to install tightvnc-java on this computer to access a virtual machine's console.

For more information about Oracle Virtualization, please visit:

http://www.oracle.com/virtualization/

Oracle VM Manager installation complete.

Please remove configuration file /tmp/ovm_configD62uIU.</pre>
<p>So now with the completion of the install we can see that the site is available at both an http and an https site running on ports 7001 and 7002 respectively.</p>
<p>Now that we have laid this foundation we can start to get into some of the neat processes around using this particular stack.</p>
<p>&nbsp;</p>
<p>ref: Oracle VM Installation and Upgrade Guide for Release 3.1.1 &#8211; <a href="http://docs.oracle.com/cd/E27300_01/E27308/E27308.pdf">http://docs.oracle.com/cd/E27300_01/E27308/E27308.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/05/installing-oracle-vm-manager-3-1-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Bash: A Better Way to Sed</title>
		<link>http://blog.allanglesit.com/2012/05/bash-a-better-way-to-sed/</link>
		<comments>http://blog.allanglesit.com/2012/05/bash-a-better-way-to-sed/#comments</comments>
		<pubDate>Tue, 01 May 2012 11:00:12 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1023</guid>
		<description><![CDATA[So I frequently find myself in a situation where I need to modify files on a fairly programmatic basis, so sed has become a friend of mine for a lot of these situations.  So lets start with some basic sed&#8230; If I have a file.. And I want to replace &#8220;teststring&#8221; with &#8220;productionvalue&#8221; then I [...]]]></description>
				<content:encoded><![CDATA[<p>So I frequently find myself in a situation where I need to modify files on a fairly programmatic basis, so sed has become a friend of mine for a lot of these situations.  So lets start with some basic sed&#8230;</p>
<p>If I have a file..</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/file.txt
blah
blah
teststring
blah
blah</pre>
<p>And I want to replace &#8220;teststring&#8221; with &#8220;productionvalue&#8221; then I could use sed.</p>
<pre class="brush: plain; title: ; notranslate"># sed -i 's/teststring/productionvalue/g' /etc/file.txt</pre>
<pre class="brush: plain; title: ; notranslate"># cat /etc/file.txt
blah
blah
productionvalue
blah
blah</pre>
<p>This is all well and good, but recently I found a better way&#8230;</p>
<p>Using perl, not only can we make the change, but we also create a backup file of the original configuration.</p>
<pre class="brush: plain; title: ; notranslate"># perl -pi.orig -e 's/teststring/productionvalue/g' /etc/file.txt</pre>
<p>So now lets take a look at our original file with the .orig extension&#8230;</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/file.txt.orig
blah
blah
teststring
blah
blah</pre>
<p>And finally our changed file&#8230;</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/file.txt
blah
blah
productionvalue
blah
blah</pre>
<p>This is certainly a more useful way of making programmatic changes while retaining the ability to quickly recover from programmatic errors&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/05/bash-a-better-way-to-sed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash: Duplicate Logical Volume Configuration for a Volume Group</title>
		<link>http://blog.allanglesit.com/2012/04/bash-duplicate-logical-volume-configuration-for-a-volume-group/</link>
		<comments>http://blog.allanglesit.com/2012/04/bash-duplicate-logical-volume-configuration-for-a-volume-group/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 11:00:16 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LVM2]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=1020</guid>
		<description><![CDATA[I recently ran into a situation where I needed to create a large number of Logical Volumes for a server replacement situation.  I could have done some manual data input, but why not take the opportunity to quickly write a script to do the hard work for me? For my situation this was a server [...]]]></description>
				<content:encoded><![CDATA[<p>I recently ran into a situation where I needed to create a large number of Logical Volumes for a server replacement situation.  I could have done some manual data input, but why not take the opportunity to quickly write a script to do the hard work for me?</p>
<p>For my situation this was a server that pulls data from other servers in order to optimize getting that data to tape.  So we had 2 VGs, one for the system and one for the data we wanted to move.  We planned on simply performing a rsync to move the data itself, but the volumes had to be pre-staged.</p>
<p>Here is the full script.  Nothing fancy, but very effective.</p>
<pre class="brush: plain; title: ; notranslate">for line in `ssh root@oldserver.domain 'lvs --noheadings -o lv_name,lv_size,vg_name --separator , | tr -d &quot; &quot; | grep oldserver-vg | grep -v unneeded-lv'`
do
lvname=`echo $line | cut -d , -f 1`
lvsize=`echo $line | cut -d , -f 2`
lvcreate -L${lvsize} newserver-vg -n ${lvname}
mkfs.reiserfs -q /dev/newserver-vg/${lvname}
mkdir /backups/${lvname}
done</pre>
<p><strong>Gather Existing Configuration</strong></p>
<p>Lets break it down&#8230;  The core of this script is gathering and formatting the existing LV configuration.</p>
<pre class="brush: plain; title: ; notranslate">lvs --noheadings -o lv_name,lv_size,vg_name --separator , | tr -d &quot; &quot; | grep oldserver-vg | grep -v unneeded-lv</pre>
<p>You will notice we are using lvs to show all of our logical volumes, but we are also telling it that we don&#8217;t want the headings to be displayed, and we only want the lv_name, lv_size, and vg_name columes to be displayed.  Additionally we want to use a comma as the separator, which makes our output easier to parse.  This gives us the core of the data we need, however we have some white space to remove, so we just pipe it through tr to get rid of that.  Now we just want to trim out some of the extra data from our output using grep.  We have two statements, one where we only include anything that contains the string oldserver-vg, and the other where we specifically exclude (with the -v) something that is not needed but previously included in our case unneeded-lv.  This would also work if you had a vgname which matched more than it should have.</p>
<p><strong>Build &#8220;For&#8221; Loop</strong></p>
<p>So now that we have a command to gather our original configuration, we need to wrap it in a for loop, and run it through SSH.</p>
<pre class="brush: plain; title: ; notranslate">for line in `ssh root@oldserver.domain 'lvs --noheadings -o lv_name,lv_size,vg_name --separator , | tr -d &quot; &quot; | grep oldserver-vg | grep -v unneeded-lv'`</pre>
<p>The way a &#8220;for&#8221; loop works is that you define a variable which represents each item in an array of data.  In our case our array of data is coming from another command (the boundaries of this command is delineated by the back-ticks) which happens to be an SSH command to the original server where the LVM configuration is intact (the boundaries of this command is delineated by the single-quotes).</p>
<p><strong>Inside the &#8220;For&#8221; Loop</strong></p>
<p>This is simple, as it goes through each line of output it will do everything between do and done.  Once it reaches done it goes back and increments to the next ${item} and starts again.  When there are no more $item then the for loop is complete, and we move on to the next part of the script.  In this particular script there is nothing after the &#8220;For&#8221; loop so the script will now be complete and your prompt will be returned.</p>
<p><strong>Inside the &#8220;For&#8221; Loop&#8230;  Define Variables</strong></p>
<p>Here we simply define our variables based on the content of $line.</p>
<pre class="brush: plain; title: ; notranslate">lvname=`echo $line | cut -d , -f 1`</pre>
<pre class="brush: plain; title: ; notranslate">lvsize=`echo $line | cut -d , -f 2`</pre>
<p>The core of each of these commands is the cut command.  The -d option sets the deliminator to &#8220;,&#8221; the -f option sets the field to the field which contains the data we need.  Which gives us the appropriate variables to actually do stuff.  So lets do it&#8230;</p>
<p><strong>Inside the &#8220;For&#8221; Loop&#8230;  Create the Logical Volumes, Format, and Make a Mounting Directory</strong></p>
<p>Now we actually do work.  If you are running this code I recommend you test it in your environment first, by inserting some debugging code instead of doing this stuff on your first run.  Unless you don&#8217;t care about the machine.  Make sure you look for pre-existing file systems and what not, if you accidently format your root you won&#8217;t be very happy&#8230;  Moving on.</p>
<pre class="brush: plain; title: ; notranslate">lvcreate -L${lvsize} newserver-vg -n ${lvname}</pre>
<p>Here we are simply creating the LVs.  You will need to hardcode the VG Name on your server which is being built up.</p>
<pre class="brush: plain; title: ; notranslate">mkfs.reiserfs -q /dev/newserver-vg/${lvname}</pre>
<p>Here we are formatting the file systems as we create them.  This particular environment prefers reiser, use your choice.</p>
<pre class="brush: plain; title: ; notranslate">mkdir /backups/${lvname}</pre>
<p>And finally to make the directories which will have the LVs mounted into.</p>
<p><strong>Final Thoughts</strong></p>
<p>The final step is to copy over the /etc/fstab and update the VG names in it from oldserver-vg to newserver-vg.  Which can be done with sed.  You could also manually mount the file systems as part of the script, or create the fstab by hand.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/04/bash-duplicate-logical-volume-configuration-for-a-volume-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ESX 5: Command Line VM Manipulation</title>
		<link>http://blog.allanglesit.com/2012/04/esx-5-command-line-vm-manipulation/</link>
		<comments>http://blog.allanglesit.com/2012/04/esx-5-command-line-vm-manipulation/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 11:00:31 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[VMWare]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[vim-cmd]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=915</guid>
		<description><![CDATA[I haven&#8217;t been working with ESX for a bit, but while I was I was mostly interacting with it via the command line.  Here is a list I had compiled while I was going through that exercise, and since I while be starting a job next week where I will no longer be interacting with [...]]]></description>
				<content:encoded><![CDATA[<p>I haven&#8217;t been working with ESX for a bit, but while I was I was mostly interacting with it via the command line.  Here is a list I had compiled while I was going through that exercise, and since I while be starting a job next week where I will no longer be interacting with much ESX I will just publish this one as-is.  It is by no means complete and frankly it is not even that helpful.  Notice that the commands which reference a specific virtual machine have a number, this is the VM ID for the VM you&#8217;d like to interact with.</p>
<p>This is specifically to interact with VMs on ESX 5.  There is also esxcli which will allow you to make hypervisor level changes such as configuring a vSwitch, the esxcli is similar to a switch in how it behaves but it is beyond the scope of this article.</p>
<p><strong>List All VMs on the Host</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/getallvms</pre>
<p><strong>Get Information for a Specific VM</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/get.guest 30</pre>
<p><strong>Get Configuration for a Specific VM</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/get.config 30</pre>
<p><strong>Get Summary for a Specific VM</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/get.summary 30</pre>
<p><strong>Get Current Power State of a Specific VM</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/power.getstate 30</pre>
<p><strong>Power On a Specific VM</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/power.on 30</pre>
<p><strong>Power Off a Specific VM (Hard)</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/power.off 30</pre>
<p><strong>Shutdown a Specific VM</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/power.shutdown 30</pre>
<p><strong>Reboot a Specific VM</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/power.reset 30</pre>
<p><strong>List a Specific VM&#8217;s Snapshots</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/get.snapshot 30</pre>
<p><strong>Unregister a VM from a ESX Host</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd vmsvc/unregister 30</pre>
<p><strong>Register a VM on a ESX Host</strong></p>
<pre class="brush: plain; title: ; notranslate"># vim-cmd solo/registervm path/to/.vmx</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/04/esx-5-command-line-vm-manipulation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Preparing Minimal Images with Debootstrap</title>
		<link>http://blog.allanglesit.com/2012/03/preparing-minimal-images-with-debootstrap/</link>
		<comments>http://blog.allanglesit.com/2012/03/preparing-minimal-images-with-debootstrap/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 11:00:04 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[debootstrap]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux-vserver]]></category>
		<category><![CDATA[lxc]]></category>
		<category><![CDATA[openvz]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=999</guid>
		<description><![CDATA[Debootstrap gives us a simple and consistent way to cleanly setup machines by installing packages directly into a file system directly from the repos.  These have the flexibility of being used across many different kind of machines. Create Directory Structure Here we are just creating the directories into which we will be installing the operating [...]]]></description>
				<content:encoded><![CDATA[<p>Debootstrap gives us a simple and consistent way to cleanly setup machines by installing packages directly into a file system directly from the repos.  These have the flexibility of being used across many different kind of machines.</p>
<p><strong>Create Directory Structure</strong></p>
<p>Here we are just creating the directories into which we will be installing the operating systems into.</p>
<pre class="brush: plain; title: ; notranslate"># mkdir -p /mnt/build/amd64 /mnt/build/i386
# cd /mnt/build/amd64; mkdir ubuntu_10.04 ubuntu_10.10 ubuntu_11.04 ubuntu_11.10 debian_5 debian_6
# cd /mnt/build/i386; mkdir ubuntu_10.04 ubuntu_10.10 ubuntu_11.04 ubuntu_11.10 debian_5 debian_6</pre>
<p><strong>Install Required Software</strong></p>
<pre class="brush: plain; title: ; notranslate"># apt-get install debootstrap</pre>
<p><strong>Install Operating Systems into the Folders</strong></p>
<p><em>Ubuntu Lucid</em></p>
<p>http://us.archive.ubuntu.com</p>
<pre class="brush: plain; title: ; notranslate"># debootstrap --arch=i386 --variant=minbase lucid /mnt/build/i386/ubuntu_10.04/ http://us.archive.ubuntu.com/ubuntu/
# debootstrap --arch=amd64 --variant=minbase lucid /mnt/build/amd64/ubuntu_10.04/ http://us.archive.ubuntu.com/ubuntu/</pre>
<p><em>Ubuntu Maverick</em></p>
<pre class="brush: plain; title: ; notranslate"># debootstrap --arch=i386 --variant=minbase maverick /mnt/build/i386/ubuntu_10.10/ http://us.archive.ubuntu.com/ubuntu/
# debootstrap --arch=amd64 --variant=minbase maverick /mnt/build/amd64/ubuntu_10.10/ http://us.archive.ubuntu.com/ubuntu/</pre>
<p><em>Ubuntu Natty</em></p>
<pre class="brush: plain; title: ; notranslate"># debootstrap --arch=i386 --variant=minbase natty /mnt/build/i386/ubuntu_11.04/ http://us.archive.ubuntu.com/ubuntu/
# debootstrap --arch=amd64 --variant=minbase natty /mnt/build/amd64/ubuntu_11.04/ http://us.archive.ubuntu.com/ubuntu/</pre>
<p><em> Ubuntu Oneiric</em></p>
<pre class="brush: plain; title: ; notranslate"># debootstrap --arch=i386 --variant=minbase oneiric /mnt/build/i386/ubuntu_11.10/ http://us.archive.ubuntu.com/ubuntu/
# debootstrap --arch=amd64 --variant=minbase oneiric /mnt/build/amd64/ubuntu_11.10/ http://us.archive.ubuntu.com/ubuntu/</pre>
<p><em>Debian Lenny</em></p>
<pre class="brush: plain; title: ; notranslate"># debootstrap --arch=i386 --variant=minbase lenny /mnt/build/i386/debian_5/ http://ftp.us.debian.org/debian/
# debootstrap --arch=amd64 --variant=minbase lenny /mnt/build/amd64/debian_5/ http://ftp.us.debian.org/debian/</pre>
<p><em>Debian Squeeze</em></p>
<pre class="brush: plain; title: ; notranslate"># debootstrap --arch=i386 --variant=minbase squeeze /mnt/build/i386/debian_6/ http://ftp.us.debian.org/debian/
# debootstrap --arch=amd64 --variant=minbase squeeze /mnt/build/amd64/debian_6/ http://ftp.us.debian.org/debian/</pre>
<p><strong>Enter the Newly Installed Environments using Chroot</strong></p>
<p>Chroot or CHange ROOT allows us to enter a given folder and have that be our new operating environment.  It becomes a completely isolated enviornment with access only to the files and utilities which already exist within that operating environment.  You do not need to enter a chroot to modify files, but you will need to enter a chroot to install software packages.</p>
<pre class="brush: plain; title: ; notranslate"># mount -o bind /proc /mnt/build/i386/ubuntu_10.04/proc/
# chroot /mnt/build/i386/ubuntu_10.04</pre>
<p>When you are ready to exit your environment and move to the next one, then break the chroot with exit, and then unmount proc.</p>
<p><strong>Exiting the Chroot (not yet)</strong></p>
<p>Before exiting make sure you make the appropriate modifications in the next section.</p>
<pre class="brush: plain; title: ; notranslate"># exit
# unmount /mnt/build/i386/ubuntu_10.04</pre>
<p>You will then need to enter the other installed templates so that you can get them sorted out as well.</p>
<p><strong>Make Modifications to Ubuntu Templates</strong></p>
<p>When using apt-get to install software I noticed these errors on Ubuntu.</p>
<pre class="brush: plain; title: ; notranslate">   LANGUAGE = (unset),
LC_ALL = (unset),
LANG = &quot;en_US.UTF-8&quot;</pre>
<pre class="brush: plain; title: ; notranslate">GPG error: http://ftp.utexas.edu lucid Release: Could not execute '/usr/bin/gpgv' to verify signature (is gpgv installed?)</pre>
<p>The first error is simply a problem with the language pack.  We can fix it by running the following.</p>
<pre class="brush: plain; title: ; notranslate"># apt-get install --reinstall language-pack-en</pre>
<p>The second error didn&#8217;t occur on oneiric, but occurred on all older versions of Ubuntu I tried.  It can be fixed by running the following.</p>
<pre class="brush: plain; title: ; notranslate"># apt-get install gpgv</pre>
<p>In addition to running those commands, I also run the following as part of my preparations.</p>
<pre class="brush: plain; title: ; notranslate"># apt-get update &amp;amp;&amp;amp; apt-get upgrade
# apt-get install vim aptitude</pre>
<p>If you have any other modifications to make on your templates now is the time to do it.</p>
<p><strong>Make Modifications to Debian Templates</strong></p>
<p>On Debian we need to fix than locale error we received on ubuntu.</p>
<p>The problem&#8230;</p>
<pre class="brush: plain; title: ; notranslate">    LANGUAGE = (unset),
LC_ALL = (unset),
LANG = &quot;en_US.UTF-8&quot;</pre>
<p>Although the fix is different.</p>
<pre class="brush: plain; title: ; notranslate"># apt-get install locales
# sed -i '/en_US.UTF-8/s/^#//' /etc/locale.gen
# locale-gen en_US.UTF-8</pre>
<p>I also run the following.</p>
<pre class="brush: plain; title: ; notranslate"># apt-get update &amp;amp;&amp;amp; apt-get upgrade
# apt-get install vim aptitude</pre>
<p><strong>Create the Final Archives</strong></p>
<p>Now we are going to tar gzip these things into there own little files so that we can simply extract as needed.  These commands will do the whole batch, instead of having to type each one manually.</p>
<pre class="brush: plain; title: ; notranslate">cd /mnt/build/i386/; for a in `ls`; do echo -n $a; tar -czf &quot;/mnt/build/&quot;$a&quot;_i386.tgz&quot; -C $a .; echo &quot;      done.&quot;; done</pre>
<pre class="brush: plain; title: ; notranslate">cd /mnt/build/amd64/; for a in `ls`; do echo -n $a; tar -czf &quot;/mnt/build/&quot;$a&quot;_amd64.tgz&quot; -C $a .; echo &quot;      done.&quot;; done</pre>
<p>Well that pretty much sorts it out for us.  Now we end up with a bunch of tgz files which can be extracted into a file system and used for whatever purpose we need to use them (lxc, openvz, vserver).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/03/preparing-minimal-images-with-debootstrap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux-KVM: Ubuntu 12.04 with Openvswitch</title>
		<link>http://blog.allanglesit.com/2012/03/linux-kvm-ubuntu-12-04-with-openvswitch/</link>
		<comments>http://blog.allanglesit.com/2012/03/linux-kvm-ubuntu-12-04-with-openvswitch/#comments</comments>
		<pubDate>Mon, 26 Mar 2012 11:00:28 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux-KVM]]></category>
		<category><![CDATA[Switching]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[openvswitch]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=956</guid>
		<description><![CDATA[UPDATE: October 29, 2012 This article doesn&#8217;t work on Ubuntu 12.10, to use Ubuntu 12.10 please refer to my new article here. Openvswitch is a better way of managing your virtual networking stacks for KVM and Xen.  This can be used instead of the bridge-utils package, and has the ability to use VLANs, LACP, QoS, [...]]]></description>
				<content:encoded><![CDATA[<p><strong>UPDATE: October 29, 2012</strong></p>
<p>This article doesn&#8217;t work on Ubuntu 12.10, to use Ubuntu 12.10 please refer to my new article <a title="Linux KVM: Ubuntu 12.10 with Openvswitch" href="http://blog.allanglesit.com/2012/10/linux-kvm-ubuntu-12-10-with-openvswitch/">here</a>.</p>
<p>Openvswitch is a better way of managing your virtual networking stacks for KVM and Xen.  This can be used instead of the bridge-utils package, and has the ability to use VLANs, LACP, QoS, sFlow, and others.  In this article we will be using Ubuntu 12.04 (beta1) to configure Openvswitch to hand out networking interfaces to KVM guests.</p>
<p>Please keep in mind that at the time of this writing Ubuntu 12.04 is beta, which means it is not fully baked for production.  Though it is looking very stable.</p>
<p><strong>Install Updates and Prerequisite Software</strong></p>
<p>Check for updates, and install some commonly used hypervisor utilities along with the openvswitch and kvm stacks.</p>
<pre class="brush: plain; title: ; notranslate"># apt-get update &amp;&amp; apt-get dist-upgrade
# apt-get install aptitude apt-show-versions ntp ntpdate vim kvm libvirt-bin vlan virtinst virt-manager virt-viewer openssh-server iperf pv openvswitch-controller openvswitch-brcompat openvswitch-switch openvswitch-datapath-source</pre>
<p><strong>Destroy the Default Libvirt Bridge (virbr0)</strong></p>
<p>We want to delete the default libvirt interface which is created by default to be used for guests (I think it is NAT &#8211; I never use it).</p>
<pre class="brush: plain; title: ; notranslate"># virsh net-destroy default
# virsh net-autostart --disable default</pre>
<p><strong>Stop Libvirt and Qemu</strong></p>
<p>This will prevent libvirt from bringing up the legacy bridge.</p>
<pre class="brush: plain; title: ; notranslate"># service libvirt-bin stop
# service qemu-kvm stop</pre>
<p><strong>Enable Openvswitch for Brcompat</strong></p>
<pre class="brush: plain; title: ; notranslate"># vi /etc/default/openvswitch-switch
BRCOMPAT=yes</pre>
<p><strong>Purge Ebtables from System</strong></p>
<p>Ebtables was needed when we were using VLANs on bridge-utils, we no longer need this for openvswitch.</p>
<pre class="brush: plain; title: ; notranslate"># aptitude purge ebtables</pre>
<p><strong>Fix DKMS Module Build</strong></p>
<p>When we originally installed openvswitch, you might have noticed an error talking about the module not available for your kernel, if you didn&#8217;t notice it you can see the same error by trying to start the openvswitch-switch service.</p>
<pre class="brush: plain; title: ; notranslate"># service openvswitch-switch start</pre>
<p>If you receive the module error, then we will need to build the openvswitch-datapath module.</p>
<pre class="brush: plain; title: ; notranslate"># module-assistant auto-install openvswitch-datapath</pre>
<p>Note that after installing new kernels you will most likely need to repeat this step, to rebuild the module.</p>
<p><strong>Restart the Openvswitch Services</strong></p>
<pre class="brush: plain; title: ; notranslate"># service openvswitch-switch restart
# service openvswitch-controller restart</pre>
<p><strong>Reboot</strong></p>
<pre class="brush: plain; title: ; notranslate"># reboot</pre>
<p><strong>Check Configuration</strong></p>
<p>Based on your reboot one of two things happened&#8230;  Your modules came back up loaded and ready for business, though more likely they didn&#8217;t come up.</p>
<p>Here is an example of a working configuration.  If you get this then move on to configuration of the switch itself.</p>
<pre class="brush: plain; title: ; notranslate"># lsmod | grep brcom
brcompat_mod 13512 0
openvswitch_mod 83993 2 brcompat_mod
# service openvswitch-switch status
ovsdb-server is running with pid 1885
ovs-vswitchd is running with pid 1908
ovs-brcompatd is running with pid 2096</pre>
<div>Here is an example of a non-working configuration.  If your modules are not loaded then you will need to get that sorted before we blow a configuration on there and try to pass traffic.</div>
<pre class="brush: plain; title: ; notranslate"># lsmod | grep brcom
# service openvswitch-switch status
ovsdb-server is running with pid 1885
ovs-vswitchd is running with pid 1908
ovs-brcompatd is running with pid 2096</pre>
<p><strong>Ensuring the Modules Load at Boot</strong></p>
<p>The easy way to fix this is to restart the openvswitch-switch service whenever you reboot your hypervisor.</p>
<pre class="brush: plain; title: ; notranslate"># service openvswitch-switch restart
* Killing ovs-brcompatd (2096)
* Killing ovs-vswitchd (1908)
* Killing ovsdb-server (1885)
* Starting ovsdb-server
* Configuring Open vSwitch system IDs
* Starting ovs-vswitchd
* Starting ovs-brcompatd
* iptables already has a rule for gre, not explicitly enabling</pre>
<p>But that might not be ideal for your situation.  As an alternative we can try and address the timing issue which is causing the whole issue in the first place.  Basically what is happening is that upstart is starting openvswitch too late, and it is failing.  If we adjust the waits in /etc/init/failsafe.conf</p>
<p>We want to change this&#8230;</p>
<pre class="brush: plain; title: ; notranslate">$PLYMOUTH message --text=&quot;Waiting for network configuration...&quot; || :
sleep 40
$PLYMOUTH message --text=&quot;Waiting up to 60 more seconds for network configuration...&quot; || :
sleep 59
$PLYMOUTH message --text=&quot;Booting system without full network configuration...&quot; || :</pre>
<p>To this&#8230;</p>
<pre class="brush: plain; title: ; notranslate">$PLYMOUTH message --text=&quot;Waiting for network configuration...&quot; || :
sleep 1
$PLYMOUTH message --text=&quot;Waiting up to 60 more seconds for network configuration...&quot; || :
sleep 1
$PLYMOUTH message --text=&quot;Booting system without full network configuration...&quot; || :</pre>
<p>Now after a reboot you shouldn&#8217;t have this problem with the modules not loading.</p>
<p><strong>Reboot</strong></p>
<pre class="brush: plain; title: ; notranslate"># reboot</pre>
<p><strong>Check Modules</strong></p>
<pre class="brush: plain; title: ; notranslate"># lsmod | grep brcom
brcompat_mod           13512  0
openvswitch_mod        83993  1 brcompat_mod</pre>
<p><strong>Design our Network Layout</strong></p>
<p>In our example we will use 2 physical interfaces, one of which (eth0) we will consider our management interface, it will have a static IP address and will be &#8220;the hypervisor&#8221; the other one (eth1) will be the uplink for our Openvswitch.  Now eth1 will have an untagged fake bridge (br0) which will be the parent for our other fake bridge (br10) which will be tagged 10.  If we had more to add they would still use br0 as the parent and then be tagged on the subordinate fake bridge.  Another important thing to keep in mind is that your uplinked switch port must support and be configured to allow your devices to tag for these other VLANs.</p>
<p><strong>Configure Openvswitch Fake Bridges</strong></p>
<pre class="brush: plain; title: ; notranslate"># ovs-vsctl add-br br0
# ovs-vsctl add-port br0 eth1
# ovs-vsctl add-br br10 br0 10
# ovs-vsctl list-br
br0
br10</pre>
<p><strong>Create Dummy Interface Entries</strong></p>
<p>We need to edit /etc/network/interfaces to add some entries</p>
<pre class="brush: plain; title: ; notranslate"># cat /etc/network/interfaces
auto eth0
iface eth0 inet static
address 10.0.0.141
netmask 255.255.255.0
gateway 10.0.0.1

auto eth1
iface eth1 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down

auto br0
iface br0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down

auto br10
iface br10 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down</pre>
<p>These bring up the interfaces with No IP address, now if you run ifconfig -a they should be visible.</p>
<p>Once you have a guest up on br0 or br10 you will see a  “vnet0” interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/03/linux-kvm-ubuntu-12-04-with-openvswitch/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Adventures in ZFS: NexentaStor with Dell Poweredge R515 Onboard Broadcom NIC</title>
		<link>http://blog.allanglesit.com/2012/03/adventures-in-zfs-nexentastor-with-dell-poweredge-r515-onboard-broadcom-nic/</link>
		<comments>http://blog.allanglesit.com/2012/03/adventures-in-zfs-nexentastor-with-dell-poweredge-r515-onboard-broadcom-nic/#comments</comments>
		<pubDate>Wed, 21 Mar 2012 11:00:09 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[ZFS]]></category>
		<category><![CDATA[adventures in zfs]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[nexenta]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[zfs]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=950</guid>
		<description><![CDATA[So recently I dealt with a rather aggravating problem.  Basically I had a couple of Poweredge R515&#8242;s to be built with NexentaStor Enterprise, which would not get a valid network configuration. The Problem During the initial setup via the console&#8230;  I selected bnx0 as the primary and set it to use DHCP, after a bit [...]]]></description>
				<content:encoded><![CDATA[<p>So recently I dealt with a rather aggravating problem.  Basically I had a couple of Poweredge R515&#8242;s to be built with NexentaStor Enterprise, which would not get a valid network configuration.</p>
<p><strong>The Problem</strong></p>
<p>During the initial setup via the console&#8230;  I selected bnx0 as the primary and set it to use DHCP, after a bit of chewing I received the error below&#8230;</p>
<pre class="brush: plain; title: ; notranslate">IOError: can not safely set interface bnx0 via DHCP.</pre>
<p>After the wizard I went into the shell to look at the configuration.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/$ show network interface bnx0
==== Interface: bnx0 ====
bnx0: flages=1000842&amp;lt;BROADCAST,RUNNING,MULTICAST,IPv4&amp;gt; mtu 1496 index 5
inet 0.0.0.0 netmask 00000000 broadcast 255.255.255.255
ether e8:9a:8f:be:25:ab</pre>
<p>The only real important points to note from this output is that the IP address is 0.0.0.0, which is expected since it threw an error during the initial configuration.  Additionally the MTU is set for 1496.</p>
<p><strong>Configure Static IP with MTU, Gateway, and Nameserver</strong></p>
<p>So perhaps the problem is specific with DHCP, so I go through the process of configuring the IP address statically.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/$ setup network interface bnx0
Option ? static
bnx0 IP address        : 10.0.8.41
bnx0 netmask            : 255.255.255.0
bnx0 mtu                    : 1500
Gateway IP address : 10.0.8.1
Name Server #1         : 8.8.8.8
Name Server #2         :
Name Server #3         :
SystemCallError: failed to configure bnx0 with ip 10.0.8.41 netmask 255.255.255.0 mtu 1500 broadcast + up: ifconfig: setifmtu: SIOCSLIFMTU: bnx0: invalid argument</pre>
<p><strong>Configure Static IP with MTU and Gateway</strong></p>
<p><strong></strong>So the error above says invalid argument, so lets remove stuff from the bottom up, no more name server.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/$ setup network interface bnx0

Option ? static
bnx0 IP address        : 10.0.8.41
bnx0 netmask            : 255.255.255.0
bnx0 mtu                    : 1500
Gateway IP address : 10.0.8.1
Name Server #1         :
Name Server #2         :
Name Server #3         :
SystemCallError: add net default: gateway 10.0.8.1: Network is unreachable </pre>
<p><strong>Configure Static IP with MTU</strong></p>
<p>So above we have an issue with being unable to reach the gateway so Nexenta won&#8217;t accept the configuration, fine lets remove that.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/$ setup network interface bnx0

Option ? static
bnx0 IP address        : 10.0.8.41
bnx0 netmask            : 255.255.255.0
bnx0 mtu                    : 1500
Gateway IP address :
Name Server #1         :
Name Server #2         :
Name Server #3         :
OK. </pre>
<p><strong>Check Interface Configuration for MTU</strong></p>
<p>So above this responds with an OK.  As in alright everything worked, but not so fast, we haven&#8217;t done anything to fix it and by definition our configuration would still be broken, no gateway and no name server.  So lets look at our configuration.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/$ show network interface bnx0
==== Interface: bnx0 ====
bnx0: flages=1000842&amp;lt;BROADCAST,RUNNING,MULTICAST,IPv4&amp;gt; mtu 1496 index 5
inet 10.0.8.41 netmask ffffff00 broadcast 10.0.8.255
ether e8:9a:8f:be:25:ab</pre>
<p><strong>Configure Static IP with MTU of 1496</strong></p>
<p>Interesting, so it didn&#8217;t actually accept our MTU of 1500, like it said it did.  Well lets see what happens if we play along and try and set the MTU to 1496 &#8211; since Nexenta is so adamant that is the correct way.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/$ setup network interface bnx0

Option ? static
bnx0 IP address        : 10.0.8.41
bnx0 netmask            : 255.255.255.0
bnx0 mtu                    : 1496
Invalid mtu '1496' please enter value in range [1500:8982]</pre>
<p>How contradictory, apparently Nexenta will only accept 1500-8982 as a valid MTU.  Looking at our configuration we can see that nothing changed, and our configuration is still broken.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/$ show network interface bnx0
==== Interface: bnx0 ====
bnx0: flages=1000842&amp;lt;BROADCAST,RUNNING,MULTICAST,IPv4&amp;gt; mtu 1496 index 5
inet 10.0.8.41 netmask ffffff00 broadcast 10.0.8.255
ether e8:9a:8f:be:25:ab</pre>
<p><strong>The Fix</strong></p>
<p>Now the problem here is that the Broadcom NICs are using an invalid MTU setting and Nexenta is not smart enough to properly handle it, so we need to tell the bnx driver how to use the Broadcom NICs.</p>
<p>Enter expert mode, this allows us to use an actual command shell, instead of the incredibly limited NMC.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/# option expert_mode = 1</pre>
<p>Now that we are in expert mode, we can do silly things like launch bash.  I have no idea why we need to say not-bash to launch bash, but we do.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/# !bash
You are about to enter the Unix (&quot;raw&quot;) shell and execute low-level Unix command(s). Warning: using low-level Unix commands is not recommended! Execute?  (y/n)</pre>
<p>Below is a little sed snippet which will allow you to uncomment the line without actually entering the file yourself.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/# sed -i '/mtu=/s/^#//' /kernel/drv/bnx.conf</pre>
<p>Quick explanation on what this sed command does, -i tells it to make changes &#8220;in-place&#8221; or directly on the file in question, without this the file is sent to stdout where the change is made.  The apostrophes annotate the full search string, separated by forward slashes.  The first section /mtu=/ is our search string, so basically any line that matches this search string will have the next part run against it.  The second section s/^#// is actually two sections, but it is a substitution section so we will treat it as one, since wherever it finds &#8220;^#&#8221; it will replace with &#8220;&#8221; so what is &#8220;^#&#8221; simple, it is a comment which occurs as the first character in a line.  This simply removes that comment.</p>
<p>A simpler but much more verbose method would be to substitute the whole line (with the comment) for the whole line without the comment.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/# sed -i 's/#mtu=1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500;/mtu=1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500;/g' /kernel/drv/bnx.conf</pre>
<p>Or if you&#8217;d prefer to handle the change manually what we are doing is uncommenting the following line from /kernel/drv/bnx.conf</p>
<pre class="brush: plain; title: ; notranslate">#mtu=1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500;</pre>
<p>Verify the change, then reboot.</p>
<pre class="brush: plain; title: ; notranslate"># cat /kernel/drv/bnx.conf | grep mtu=
mtu=1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500,1500;</pre>
<pre class="brush: plain; title: ; notranslate"># reboot</pre>
<p>After the reboot, we can finally appropriately configure our networking.</p>
<pre class="brush: plain; title: ; notranslate">nmc@myhost:/$ setup network interface bnx0
Option ? static
bnx0 IP address        : 10.0.8.41
bnx0 netmask            : 255.255.255.0
bnx0 mtu                    : 1500
Gateway IP address : 10.0.8.1
Name Server #1         : 8.8.8.8
Name Server #2         :
Name Server #3         :
Enabling bnx0 as 10.0.8.41/255.255.255.0 mtu 1500 ... OK.</pre>
<p><strong>Bottom Line</strong></p>
<p>Once I implemented this change I was able to successfully configure my networking with either DHCP or static, with the appropriate MTU for my purpose.  I have no idea why this is required, if a simple uncommenting of the line is required then why would Nexenta as a Solution Builder perform that uncommenting for me to spare me from the trouble of doing it myself.  I personally prefer &#8220;pure&#8221; ZFS solutions without the pretty interface, especially considering that I spent more time trying to learn how to use the Nexenta Management Console (command line) then I should have had to based on my experience.  Add into this the fact that I have to do low level changes like this just to get basic networking so that I can run through the wizard.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/03/adventures-in-zfs-nexentastor-with-dell-poweredge-r515-onboard-broadcom-nic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Online Support: The Verbal Blue Screen of Death</title>
		<link>http://blog.allanglesit.com/2012/03/microsoft-online-support-the-verbal-blue-screen-of-death/</link>
		<comments>http://blog.allanglesit.com/2012/03/microsoft-online-support-the-verbal-blue-screen-of-death/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 19:20:06 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[Completely Non-Technical]]></category>
		<category><![CDATA[General Information]]></category>
		<category><![CDATA[enterprise support]]></category>
		<category><![CDATA[funnty]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[non-technical]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=976</guid>
		<description><![CDATA[So today we had the need to call Microsoft Online Support, we were definitely suprised, to experience what I have coined as the &#8220;Verbal Blue Screen of Death&#8221;.  So apparently, if you are in need of Microsoft Online Support then tough cookies.  This was as of 2PM on March 20, 2012.  Below find the link [...]]]></description>
				<content:encoded><![CDATA[<p>So today we had the need to call Microsoft Online Support, we were definitely suprised, to experience what I have coined as the &#8220;Verbal Blue Screen of Death&#8221;.  So apparently, if you are in need of Microsoft Online Support then tough cookies.  This was as of 2PM on March 20, 2012.  Below find the link to the MP3.</p>
<p><a href="http://blog.allanglesit.com/wp-content/uploads/2012/03/verbal-bsod.mp3">verbal-bsod</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/03/microsoft-online-support-the-verbal-blue-screen-of-death/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://blog.allanglesit.com/wp-content/uploads/2012/03/verbal-bsod.mp3" length="86415" type="audio/mpeg" />
		</item>
		<item>
		<title>KVM Guests: Windows NT&#8230;  What?</title>
		<link>http://blog.allanglesit.com/2012/03/kvm-guests-windows-nt-what/</link>
		<comments>http://blog.allanglesit.com/2012/03/kvm-guests-windows-nt-what/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 11:00:11 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux-KVM]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[kvm guests]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=951</guid>
		<description><![CDATA[OK so you have been kicking around an old NT machine for years, neigh, a decade.  So what do you do with it?  Realistically the machine has already sustained numerous failures, and it won&#8217;t make it through another one.  We have all fought this battle.  I personally fought this battle many years ago and frankly [...]]]></description>
				<content:encoded><![CDATA[<p>OK so you have been kicking around an old NT machine for years, neigh, a decade.  So what do you do with it?  Realistically the machine has already sustained numerous failures, and it won&#8217;t make it through another one.  We have all fought this battle.  I personally fought this battle many years ago and frankly P2V is never clean when coming from NT.  But if you could upgrade then you would have already.</p>
<p>I fought the original P2V battle with NT many years ago (and emerged bloody but victorious), I don&#8217;t remember the exact process we went through but it wound its way through every virtualization product to get it to its final resting place of Hyper-V (or so we thought).  The purpose of this article is to help you get NT running on Linux KVM, in my case from a Hyper-V VM, though a &#8220;fresh&#8221; install should work as well.  For those of you looking to go from physical, when I did it years ago I think I used VMWare Converter to create an image, and then the VirtualBox tools to convert it to vdi, and then to vhd (fully allocated).  Then once that was done got it running in VirtualBox before dragging it to Hyper-V.</p>
<p><strong>Final, Working XML</strong></p>
<pre class="brush: xml; title: ; notranslate">&lt;domain type='kvm'&gt;
&lt;name&gt;ntmachine&lt;/name&gt;
&lt;description&gt;NT Machine&lt;/description&gt;
&lt;memory&gt;524288&lt;/memory&gt;
&lt;currentMemory&gt;524288&lt;/currentMemory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;os&gt;
&lt;type arch='x86_64' machine='pc-0.14'&gt;hvm&lt;/type&gt;
&lt;boot dev='hd'/&gt;
&lt;/os&gt;
&lt;cpu match='exact'&gt;
&lt;model&gt;pentium&lt;/model&gt;
&lt;/cpu&gt;
&lt;clock offset='localtime'/&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;restart&lt;/on_crash&gt;
&lt;devices&gt;
&lt;emulator&gt;/usr/bin/kvm&lt;/emulator&gt;
&lt;disk type='block' device='disk'&gt;
&lt;driver name='qemu' type='raw'/&gt;
&lt;source dev='/dev/usdckvm202/vm_newmfg_boot'/&gt;
&lt;target dev='hda' bus='ide'/&gt;
&lt;/disk&gt;
&lt;disk type='file' device='cdrom'&gt;
&lt;driver name='qemu' type='raw'/&gt;
&lt;target dev='hdc' bus='ide'/&gt;
&lt;readonly/&gt;
&lt;/disk&gt;
&lt;controller type='ide' index='0'&gt;
&lt;/controller&gt;
&lt;interface type='bridge'&gt;
&lt;mac address='00:1d:d8:b7:1c:5f'/&gt;
&lt;source bridge='br0'/&gt;
&lt;model type='ne2k_pci'/&gt;
&lt;/interface&gt;
&lt;serial type='pty'&gt;
&lt;target port='0'/&gt;
&lt;/serial&gt;
&lt;console type='pty'&gt;
&lt;target type='serial' port='0'/&gt;
&lt;/console&gt;
&lt;input type='tablet' bus='usb'/&gt;
&lt;input type='mouse' bus='ps2'/&gt;
&lt;graphics type='vnc' port='-1' autoport='yes'/&gt;
&lt;video&gt;
&lt;model type='vga' vram='9216' heads='1'/&gt;
&lt;/video&gt;
&lt;/devices&gt;
&lt;/domain&gt;</pre>
<p>Now in the above there are a couple of key areas I want to point out.  The CPU, Network Cards, and Disks are key.</p>
<p><strong>CPU</strong></p>
<p>We need to virtualize a specific processor to make NT happy, in this case the predominant processor of the era was the pentium.</p>
<pre class="brush: plain; title: ; notranslate">&lt;cpu match='exact'&gt;
&lt;model&gt;pentium&lt;/model&gt;
&lt;/cpu&gt;</pre>
<p><strong>Network Cards</strong></p>
<p>In order to have working networking we must emulate a network device which actually existed, the ne2k_pci NIC was very common and has a driver included in the NT Server CD the RTL80292.</p>
<pre class="brush: plain; title: ; notranslate">&lt;interface type='bridge'&gt;
&lt;mac address='00:1d:d8:b7:1c:5f'/&gt;
&lt;source bridge='br0'/&gt;
&lt;model type='ne2k_pci'/&gt;
&lt;/interface&gt;</pre>
<p><strong>Disks</strong></p>
<p>Here we just need to use IDE, no VirtIO (obviously).  Also here I am using a Logical Volume instead of a raw disk image file, simply because that is how I like to run my production environments, if you plan on using a file, then adjust your XML so that you are referencing a file.</p>
<pre class="brush: plain; title: ; notranslate">&lt;disk type='block' device='disk'&gt;
&lt;driver name='qemu' type='raw'/&gt;
&lt;source dev='/dev/usdckvm202/vm_newmfg_boot'/&gt;
&lt;target dev='hda' bus='ide'/&gt;
&lt;/disk&gt;</pre>
<p><strong>Other Notes</strong></p>
<p>I also removed anything extraneous that I thought could cause problems, everything in the &lt;features&gt; tag (acpi, apic, pae) I also pulled the memballoon stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/03/kvm-guests-windows-nt-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Equallogic: Remove Volume Snapshot Reserve</title>
		<link>http://blog.allanglesit.com/2012/03/equallogic-remove-volume-snapshot-reserve/</link>
		<comments>http://blog.allanglesit.com/2012/03/equallogic-remove-volume-snapshot-reserve/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 11:00:52 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[iSCSI]]></category>
		<category><![CDATA[equallogic]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[snap-reserve]]></category>
		<category><![CDATA[snapshots]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=944</guid>
		<description><![CDATA[So if you purchased  a Equallogic and put it into production one of the first things that you notice is that your xTB didn&#8217;t go as far as you originally planned, this is because Equallogic by default comes with a 100% snapshot reserve on all volumes that you create.  This means that if you allocate [...]]]></description>
				<content:encoded><![CDATA[<p>So if you purchased  a Equallogic and put it into production one of the first things that you notice is that your xTB didn&#8217;t go as far as you originally planned, this is because Equallogic by default comes with a 100% snapshot reserve on all volumes that you create.  This means that if you allocate a 1TB LUN, then the system provisions 1TB of LUN space and an additional 1TB of snapshot reserve for this LUN.  This is neither good nor bad.  However this is not always necessary.  If you plan on making little use of snapshots you may want to decrease this amount of reserve or in my case remove it entirely (as we don&#8217;t plan on using it at all).</p>
<p><strong>Examine the Pool and the Existing Free Space and Capacity</strong></p>
<p>Notice that we get two different results with regard to FreeSpace.  This is because the &#8220;pool show&#8221; command will deduct the snap-reserves of all allocated volumes and thus show us the actual usable space for provisioning a new volume.  Alternatively &#8220;member show -poolinfo&#8221; will leave the snapshot reserve space unless it is actually written, so basically we have our 363GB + 2TB in reserves &#8211; actual space used by snapshots (in this case 551GB).</p>
<pre class="brush: plain; title: ; notranslate">SANGroup00&gt; pool show
Name                 Default Members Volumes Capacity   FreeSpace
-------------------- ------- ------- ------- ---------- ----------
default              true    1       2       4.35TB     363.22GB

SANGroup00&gt; member show -poolinfo
Name       Status  Version    Disks Capacity   FreeSpace  Connections Pool
---------- ------- ---------- ----- ---------- ---------- ----------- -------
EQL00      online  V5.1.1 (R1 12    4.35TB     1.89TB     24          default
85010)     </pre>
<p><strong>Show Existing Configuration of the First Volume<br />
</strong></p>
<p>Now in the below output we are looking at the configuration of Volume00.  We want to notice, the snap-reserve, snap-reserve-available, and snapshots field.  You will see that in my example we have a 100% reserve (which is default) and that we have 54% of that snap-reserve available.  This means that we have snapshots in the snapshots field, and that we are using some of that space (which means part of it is no longer &#8220;reserved&#8221;).</p>
<pre class="brush: plain; title: ; notranslate">SANGroup00&gt; volume select Volume00
SANGroup00(volume_Volume00)&amp;gt; show
_____________________________ Volume Information ______________________________
Name: Volume00                 Size: 1TB
VolReserve: 1TB                        VolReserveInUse: 492.7GB
ReplReserveInUse: 0MB                  iSCSI Alias: Volume00
iSCSI Name:                            ActualMembers: 1
iqn.2001-05.com.equallogic:8-cb2b76- Snap-Warn: 10%
a51cd9059-188000000244f04f-volume00  Snap-Depletion: delete-oldest
Description:
Snap-Reserve: 100%                     Snap-Reserve-Avail: 54% (551.86GB)
Permission: read-write                 DesiredStatus: online
Status: online                         Connections: 8
Snapshots: 1                           Bind:
Type: not-replicated                   ReplicationReserveSpace: 0MB
Replicas: 0                            ReplicationPartner:
Pool: default                          Transmitted-Data: 1011.65GB
Received-Data: 3.15TB                  Pref-Raid-Policy: none
Pref-Raid-Policy-Status: none          Thin-Provision: disabled
Thin-Min-Reserve: 0% (0MB)             Thin-Growth-Warn: 0% (0MB)
Thin-Growth-Max: 0% (0MB)              ReplicationTxData: 0MB
MultiHostAccess: enabled               iSNS-Discovery: disabled
Replica-Volume-Reserve: 0MB            Thin-Clone: N
Template: N                            NAS File System: N
Administrator:                         Thin-Warn-Mode: offline
_______________________________________________________________________________</pre>
<p><strong>Remove the Snapshot from the First Volume<br />
</strong></p>
<p>The snapshot we have will no longer be needed so we are getting rid of that now.</p>
<pre class="brush: plain; title: ; notranslate">SANGroup00(volume_Volume00)&gt; snapshot show
Name                        Permission Status      Schedule Connections
--------------------------- ---------- ----------- -------- -----------
Volume00-2012-01-04 read-write offline              0
-20:20:43.3.1

SANGroup00(volume_Volume00)&gt; snapshot delete Volume00-2012-01-04-20:20:43.3.1
Do you want to delete the snapshot? (y/n) [n]y

Snapshot deletion succeeded.</pre>
<p><strong>Modify the Existing Snap-Reserve of the First Volume<br />
</strong></p>
<p>I am removing the snap-reserve in its entirety.  If you simply want to decrease the space available for snapshots use an appropriate percentage.</p>
<pre class="brush: plain; title: ; notranslate">SANGroup00(volume_Volume00)&gt; snap-reserve 0%</pre>
<p><strong>Review Configuration of First Volume</strong></p>
<p>Make sure everything looks right before moving on.</p>
<pre class="brush: plain; title: ; notranslate">SANGroup00(volume_Volume00)&gt; show
_____________________________ Volume Information ______________________________
Name: Volume00                 Size: 1TB
VolReserve: 1TB                        VolReserveInUse: 492.77GB
ReplReserveInUse: 0MB                  iSCSI Alias: Volume00
iSCSI Name:                            ActualMembers: 1
iqn.2001-05.com.equallogic:8-cb2b76- Snap-Warn: 10%
a51cd9059-188000000244f04f-volume00  Snap-Depletion: delete-oldest
Description:
Snap-Reserve: 0%                       Snap-Reserve-Avail: 0% (0MB)
Permission: read-write                 DesiredStatus: online
Status: online                         Connections: 8
Snapshots: 0                           Bind:
Type: not-replicated                   ReplicationReserveSpace: 0MB
Replicas: 0                            ReplicationPartner:
Pool: default                          Transmitted-Data: 1015.44GB
Received-Data: 3.15TB                  Pref-Raid-Policy: none
Pref-Raid-Policy-Status: none          Thin-Provision: disabled
Thin-Min-Reserve: 0% (0MB)             Thin-Growth-Warn: 0% (0MB)
Thin-Growth-Max: 0% (0MB)              ReplicationTxData: 0MB
MultiHostAccess: enabled               iSNS-Discovery: disabled
Replica-Volume-Reserve: 0MB            Thin-Clone: N
Template: N                            NAS File System: N
Administrator:                         Thin-Warn-Mode: offline
_______________________________________________________________________________</pre>
<p><strong>Show Existing Configuration for the Second Volume</strong></p>
<p>Check our snap-reserve, snap-reserve-avail, and snapshots.</p>
<pre class="brush: plain; title: ; notranslate">SANGroup00&gt; volume select Volume01
SANGroup00(volume_Volume01)&gt; show
_____________________________ Volume Information ______________________________
Name: Volume01                        Size: 1TB
VolReserve: 1TB                        VolReserveInUse: 875.07GB
ReplReserveInUse: 0MB                  iSCSI Alias: TestDS
iSCSI Name:                            ActualMembers: 1
iqn.2001-05.com.equallogic:8-cb2b76- Snap-Warn: 10%
8cecd9059-2b20000000b4ec1a-volume01  Snap-Depletion: delete-oldest
Description:                           Snap-Reserve: 100%
Snap-Reserve-Avail: 100% (1TB)         Permission: read-write
DesiredStatus: online                  Status: online
Connections: 8                         Snapshots: 0
Bind:                                  Type: not-replicated
ReplicationReserveSpace: 0MB           Replicas: 0
ReplicationPartner:                    Pool: default
Transmitted-Data: 5.46TB               Received-Data: 7.77TB
Pref-Raid-Policy: none                 Pref-Raid-Policy-Status: none
Thin-Provision: disabled               Thin-Min-Reserve: 0% (0MB)
Thin-Growth-Warn: 0% (0MB)             Thin-Growth-Max: 0% (0MB)
ReplicationTxData: 0MB                 MultiHostAccess: enabled
iSNS-Discovery: enabled                Replica-Volume-Reserve: 0MB
Thin-Clone: N                          Template: N
NAS File System: N                     Administrator:
Thin-Warn-Mode: offline
_______________________________________________________________________________</pre>
<p><strong>Modify the Existing Snap-Reserve for Second Volume</strong></p>
<p>Again simply removing the snap-reserve.</p>
<pre class="brush: plain; title: ; notranslate">SANGroup00(volume_Volume01)&gt; snap-reserve 0%</pre>
<p><strong>Review Configuration of Second Volume</strong></p>
<p>Sanity check our changes to the second volume.</p>
<pre class="brush: plain; title: ; notranslate">SANGroup00(volume_Volume01)&gt; show
_____________________________ Volume Information ______________________________
Name: Volume01                        Size: 1TB
VolReserve: 1TB                        VolReserveInUse: 875.07GB
ReplReserveInUse: 0MB                  iSCSI Alias: TestDS
iSCSI Name:                            ActualMembers: 1
iqn.2001-05.com.equallogic:8-cb2b76- Snap-Warn: 10%
8cecd9059-2b20000000b4ec1a-volume01  Snap-Depletion: delete-oldest
Description:                           Snap-Reserve: 0%
Snap-Reserve-Avail: 0% (0MB)           Permission: read-write
DesiredStatus: online                  Status: online
Connections: 8                         Snapshots: 0
Bind:                                  Type: not-replicated
ReplicationReserveSpace: 0MB           Replicas: 0
ReplicationPartner:                    Pool: default
Transmitted-Data: 5.46TB               Received-Data: 7.77TB
Pref-Raid-Policy: none                 Pref-Raid-Policy-Status: none
Thin-Provision: disabled               Thin-Min-Reserve: 0% (0MB)
Thin-Growth-Warn: 0% (0MB)             Thin-Growth-Max: 0% (0MB)
ReplicationTxData: 0MB                 MultiHostAccess: enabled
iSNS-Discovery: enabled                Replica-Volume-Reserve: 0MB
Thin-Clone: N                          Template: N
NAS File System: N                     Administrator:
Thin-Warn-Mode: offline
_______________________________________________________________________________</pre>
<p><strong>Examine the Pool and the New Free Space and Capacity</strong></p>
<p>Now we should notice a significantly different FreeSpace indications on both commands, and they should match if you disabled all snap-reserves on all volumes.</p>
<pre class="brush: plain; title: ; notranslate">SANGroup00&gt; pool show
Name                 Default Members Volumes Capacity   FreeSpace
-------------------- ------- ------- ------- ---------- ----------
default              true    1       2       4.35TB     2.35TB

SANGroup00&gt; member show -poolinfo
Name       Status  Version    Disks Capacity   FreeSpace  Connections Pool
---------- ------- ---------- ----- ---------- ---------- ----------- -------
EQL00      online  V5.1.1 (R1 12    4.35TB     2.35TB     24          default
85010)  </pre>
<p><strong>Configure the Default Snap-Reserve</strong></p>
<p>Of course if you don&#8217;t already have a bunch of volumes on which to make this change you can always just change the default behavior.  Then all subsequently created volumes will have a snap-reserve of whatever you have picked.</p>
<pre class="brush: plain; title: ; notranslate">SANGroup00&gt; grpparams def-snap-reserve 0%</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/03/equallogic-remove-volume-snapshot-reserve/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gnome3: Disable Hot Corners</title>
		<link>http://blog.allanglesit.com/2012/03/gnome3-disable-hot-corners/</link>
		<comments>http://blog.allanglesit.com/2012/03/gnome3-disable-hot-corners/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 12:00:32 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[gnome3]]></category>
		<category><![CDATA[hot corners]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=913</guid>
		<description><![CDATA[I sincerely hate Hot Corners in Gnome3.  This article will walk you through disabling them, because you probably hate them as much as I do (you&#8217;re here right)&#8230; So firstly what are hot corners, and why do I hate them?  Hot corners is the upper left hand corner of your screen (0,0) the idea is [...]]]></description>
				<content:encoded><![CDATA[<p>I sincerely hate Hot Corners in Gnome3.  This article will walk you through disabling them, because you probably hate them as much as I do (you&#8217;re here right)&#8230;</p>
<p>So firstly what are hot corners, and why do I hate them?  Hot corners is the upper left hand corner of your screen (0,0) the idea is that if you move your mouse into the upper left hand corner then you must want the dash to come up.  However it frustrates me, because sometimes when I am typing or cussing or both, I will inadvertently bump my mouse and then I end up in the dash.</p>
<p>The file we need to change is /usr/share/gnome-shell/js/ui/layout.js</p>
<p>Here is the chunk of the file we are interested in:</p>
<pre class="brush: plain; title: ; notranslate">        this._corner = new Clutter.Rectangle({ name: 'hot-corner',
width: 1,
height: 1,
opacity: 0,
reactive: true });</pre>
<p>We want to change that to:</p>
<pre class="brush: plain; title: ; notranslate">        this._corner = new Clutter.Rectangle({ name: 'hot-corner',
width: 1,
height: 1,
opacity: 0,
reactive: false });</pre>
<p>Notice the only change is that we are making this not reactive.</p>
<p>Now after a reboot the hot corners should no longer be an issue.</p>
<p><strong>UPDATE 19 FEB 2013</strong></p>
<p>A little cleaner way to accomplish this same way, without having to open up a text editor would be to use awk&#8230;  I find myself doing this often due to updates that overwrite my configuration.</p>
<pre class="brush: plain; title: ; notranslate"># awk '/this._corner = new Clutter.Rectangle/,/ });/ { sub(/reactive: true/, &quot;reactive: false&quot;);} { print }' /usr/share/gnome-shell/js/ui/layout.js &gt; /usr/share/gnome-shell/js/ui/layout.js.tmp; mv /usr/share/gnome-shell/js/ui/layout.js /usr/share/gnome-shell/js/ui/layout.js.orig; mv /usr/share/gnome-shell/js/ui/layout.js.tmp /usr/share/gnome-shell/js/ui/layout.js</pre>
<p>Now what exactly are we doing?</p>
<p>Step 1 &#8211; Look for a block of text.</p>
<p>Find block starting with &#8220;this._corner = new Clutter.Rectangle&#8221; and ending with &#8221; });&#8221;</p>
<p>Step 2 &#8211; Substitute within that block only.</p>
<p>&#8220;reactive: true&#8221; will become &#8220;reactive: false&#8221; only within the block.  There are other instances of reactive: true which we don&#8217;t want to modify.</p>
<p>Step 3 &#8211; Output the modified file into a temporary file.</p>
<p>&#8220;&gt; /usr/share/gnome-shell/js/ui/layout.js.tmp&#8221;</p>
<p>Step 4 &#8211; Rearrange the files</p>
<p>&#8220;mv /usr/share/gnome-shell/js/ui/layout.js /usr/share/gnome-shell/js/ui/layout.js.orig; mv /usr/share/gnome-shell/js/ui/layout.js.tmp /usr/share/gnome-shell/js/ui/layout.js&#8221;</p>
<p>&nbsp;</p>
<p>This will leave you with an active configuration which will not have reactive hot corners.</p>
<pre class="brush: plain; title: ; notranslate"># awk '/this._corner = new Clutter.Rectangle/,/ });/' /usr/share/gnome-shell/js/ui/layout.js
this._corner = new Clutter.Rectangle({ name: 'hot-corner',
width: 1,
height: 1,
opacity: 0,
reactive: false });</pre>
<p>As well as a backup of the original configuration file.  That can be put back into service if need be.</p>
<pre class="brush: plain; title: ; notranslate"># awk '/this._corner = new Clutter.Rectangle/,/ });/' /usr/share/gnome-shell/js/ui/layout.js.orig
this._corner = new Clutter.Rectangle({ name: 'hot-corner',
width: 1,
height: 1,
opacity: 0,
reactive: true });</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/03/gnome3-disable-hot-corners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ESX 5: Link Aggregation with Netgear GSM7352S</title>
		<link>http://blog.allanglesit.com/2012/03/esx-5-link-aggregation-with-netgear-gsm7352s/</link>
		<comments>http://blog.allanglesit.com/2012/03/esx-5-link-aggregation-with-netgear-gsm7352s/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 12:00:17 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Switching]]></category>
		<category><![CDATA[VMWare]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[esxcli]]></category>
		<category><![CDATA[gsm7352S]]></category>
		<category><![CDATA[lacp]]></category>
		<category><![CDATA[lag]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=904</guid>
		<description><![CDATA[As one of our final validation points in an ongoing project has been enabling ESX to use a LAG on both the Management and VM Networks.  The last time we did this we were unable to get it to work, and it turns out the solution was actually very simple.  Basically the core of the [...]]]></description>
				<content:encoded><![CDATA[<p>As one of our final validation points in an ongoing project has been enabling ESX to use a LAG on both the Management and VM Networks.  The last time we did this we were unable to get it to work, and it turns out the solution was actually very simple.  Basically the core of the issue was that we were attempting to use Dynamic LACP which ESX does not support, instead you are to use Static LACP.</p>
<p><strong>Create New LAG</strong></p>
<pre class="brush: plain; title: ; notranslate">(switch01)# configure
(switch01) (Config)# port-channel esxhost00-vmnet
(switch01) (Config)# exit</pre>
<p><strong>Show New LAG</strong></p>
<pre class="brush: plain; title: ; notranslate">(switch01) #show port-channel

Logical Interface Group Id Port-Channel Name Link State Mbr Ports Active Ports
----------------- -------- ----------------- ---------- --------- ------------
0/1/11            11       esxhost00-vmnet   Down       </pre>
<p>The above command gives us the Logical Interface, which we will need.  But if we look at it with a different command we can see the problem.</p>
<pre class="brush: plain; title: ; notranslate">(switch01) #show port-channel all

Port-                  Link
Log.       Channel            Adm. Trap  STP           Mbr      Port    Port
Intf        Name        Link  Mode Mode  Mode   Type   Ports    Speed   Active
------ --------------- ------ ---- ---- ------ ------- ------ --------- ------
lag 11 esxhost00-vmnet Up     En.  En.  En.    Dynamic</pre>
<p>The problem here is that by default we create LAGs in dynamic mode.  ESX requires static mode.</p>
<p><strong>Set the LACP Mode as Static</strong></p>
<pre class="brush: plain; title: ; notranslate">(switch01)# configure
(switch01) (Config)#interface 0/1/11
(switch01) (Interface 0/1/11)#port-channel static
(switch01) (Interface 0/1/11)#exit</pre>
<p><strong>Down the Switchport for the Standby Vmnic</strong></p>
<pre class="brush: plain; title: ; notranslate">(switch01)# configure
(switch01) (Config)#interface 2/0/2
(switch01) (Interface 2/0/2)#shutdown
(switch01) (Interface 2/0/2)#exit</pre>
<p><strong>Review Existing ESX Portgroup Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate"># esxcli network vswitch standard portgroup policy failover get --portgroup-name=&quot;VM Network&quot;
Load Balancing: srcport
Network Failure Detection: link
Notify Switches: true
Failback: true
Active Adapters: vmnic4
Standby Adapters: vmnic6
Unused Adapters:
Override Vswitch Load Balancing: false
Override Vswitch Network Failure Detection: false
Override Vswitch Notify Switches: false
Override Vswitch Failback: false
Override Vswitch Uplinks: true
# esxcli network vswitch standard portgroup policy failover get --portgroup-name=&quot;Management Network&quot;
Load Balancing: srcport
Network Failure Detection: link
Notify Switches: true
Failback: true
Active Adapters: vmnic4
Standby Adapters: vmnic6
Unused Adapters:
Override Vswitch Load Balancing: false
Override Vswitch Network Failure Detection: false
Override Vswitch Notify Switches: false
Override Vswitch Failback: false
Override Vswitch Uplinks: true</pre>
<p><strong>Change Existing ESX Portgroup Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate"># esxcli network vswitch standard portgroup policy failover set --portgroup-name=&quot;VM Network&quot; --load-balancing=iphash --failure-detection=link --notify-switches true --failback false --active-uplinks=vmnic4,vmnic6
# esxcli network vswitch standard portgroup policy failover set --portgroup-name=&quot;Management Network&quot; --load-balancing=iphash --failure-detection=link --notify-switches true --failback false --active-uplinks=vmnic4,vmnic6</pre>
<p><strong>Review New ESX Portgroup Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate"># esxcli network vswitch standard portgroup policy failover get --portgroup-name=&quot;VM Network&quot;
Load Balancing: iphash
Network Failure Detection: link
Notify Switches: true
Failback: false
Active Adapters: vmnic4, vmnic6
Standby Adapters:
Unused Adapters:
Override Vswitch Load Balancing: true
Override Vswitch Network Failure Detection: true
Override Vswitch Notify Switches: true
Override Vswitch Failback: true
Override Vswitch Uplinks: true
# esxcli network vswitch standard portgroup policy failover get --portgroup-name=&quot;Management Network&quot;
Load Balancing: iphash
Network Failure Detection: link
Notify Switches: true
Failback: false
Active Adapters: vmnic4, vmnic6
Standby Adapters:
Unused Adapters:
Override Vswitch Load Balancing: true
Override Vswitch Network Failure Detection: true
Override Vswitch Notify Switches: true
Override Vswitch Failback: true
Override Vswitch Uplinks: true</pre>
<p><strong>Add Both Switchports to the LAG</strong></p>
<pre class="brush: plain; title: ; notranslate">(switch01)# configure
(switch01) (Config)#interface 2/0/3
(switch01) (Interface 2/0/3)#addport 0/1/11
(switch01) (Interface 2/0/3)#exit
(switch01) (Config)#interface 2/0/2
(switch01) (Interface 2/0/2)#addport 0/1/11
(switch01) (Interface 2/0/2)#exit
(switch01) (Config)#exit</pre>
<p><strong>Review LAG Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate">(switch01) #show port-channel all

Port-                  Link
Log.       Channel            Adm. Trap  STP           Mbr      Port    Port
Intf        Name        Link  Mode Mode  Mode   Type   Ports    Speed   Active
------ --------------- ------ ---- ---- ------ ------- ------ --------- ------
lag 11 esxhost00-vmnet Up     En.  En.  En.    Static  2/0/3 Auto      True
2/0/2 Auto      False </pre>
<p><strong>Verify ESX Connectivity</strong></p>
<p>So now that we have a LAG configured and operational albeit only on one port, the traffic will either work or not.  So if you have connectivity then you should be able to safely enable the disabled port (in my case 2/0/2) and not have any problems with your traffic.  Now if you do have problems with connectivity, then you probably have a problem with something like VLANs not being configured correctly on the LAG, we ran into that when we put this into production.</p>
<p><strong>Up the Switchport for the Standby Vmnic</strong></p>
<pre class="brush: plain; title: ; notranslate">(switch01) #configure
(switch01) (Config)#interface 2/0/2
(switch01) (Interface 2/0/2)#no shutdown
(switch01) (Interface 2/0/2)#exit
(switch01) (Config)#exit</pre>
<p><strong>Review Final LAG Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate">(switch01) #show port-channel all

Port-                  Link
Log.       Channel            Adm. Trap  STP           Mbr      Port    Port
Intf        Name        Link  Mode Mode  Mode   Type   Ports    Speed   Active
------ --------------- ------ ---- ---- ------ ------- ------ --------- ------
lag 11 vdihost00-vmnet Up     En.  En.  En.    Static  2/0/3 Auto      True
2/0/2 Auto      True   </pre>
<p>Now notice here that we are showing the LAGs interface up with both ports Active, so assuming that you still have basic connectivity to each of your vswitches then you should be good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/03/esx-5-link-aggregation-with-netgear-gsm7352s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dell PowerConnect 6224: Stacking Module Dual Master</title>
		<link>http://blog.allanglesit.com/2012/02/dell-powerconnect-6224-stacking-module-dual-master/</link>
		<comments>http://blog.allanglesit.com/2012/02/dell-powerconnect-6224-stacking-module-dual-master/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 12:00:31 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Switching]]></category>
		<category><![CDATA[jumbo-frames]]></category>
		<category><![CDATA[mtu 9216]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[powerconnect]]></category>
		<category><![CDATA[stack-port]]></category>
		<category><![CDATA[stacking]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=868</guid>
		<description><![CDATA[We use a couple of Dell PowerConnect 6224 switches in our storage network, however when they were first deployed we ran into an issue with the stacking modules. Basically when you brought up the switches they would both see themselves as master, and would not &#8220;stack&#8221; correctly. Turns out the solution was rather easy but [...]]]></description>
				<content:encoded><![CDATA[<p>We use a couple of Dell PowerConnect 6224 switches in our storage network, however when they were first deployed we ran into an issue with the stacking modules. Basically when you brought up the switches they would both see themselves as master, and would not &#8220;stack&#8221; correctly. Turns out the solution was rather easy but not well documented.  Also as a side note, I have a friend with a couple of PowerConnect 6248 switches where he had the same issue.  So it appears this issue spans the whole family at least.</p>
<p>The core of this issue is that in the previous generation there was a 10g module and a separate stacking module.  With the current version they decided to simply have one module that is 10g or stacking, and you can set the mode to toggle between them, this of course is good for Dell, because it requires them to maintain smaller inventories, and also it is good for you because if your needs change you can re-purpose the same module for a completely different use-case.</p>
<p>I am not a &#8220;switch&#8221; guy, I find the stuff boring in most cases, however this was just an interesting enough issue with a simple enough fix that I decided to document the fix.  This article assumes that you know how to connect to the console of your switch and that you are familiar with the basics of configuring a switch.</p>
<p><strong>Enter Enable Mode</strong></p>
<pre class="brush: plain; title: ; notranslate">&gt; enable </pre>
<p><strong>View Current Stack Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate"># show stack-port
Configured  Running
Stack      Stack      Link       Link
Unit    Interface       Mode       Mode       Status     Speed (Gb/s)
---- ---------------- ---------- ---------- ------------ ------------
1    xg1              Ethernet   Ethernet   Link Down    Unknown
1    xg2              Ethernet   Ethernet   Link Down    Unknown
1    xg3              Ethernet   Ethernet   Link Down    Unknown
1    xg4              Ethernet   Ethernet   Link Down    Unknown    </pre>
<p><strong>Enter Configuration Mode</strong></p>
<pre class="brush: plain; title: ; notranslate"># config</pre>
<p><strong>Enter Stack Configuration Mode</strong></p>
<pre class="brush: plain; title: ; notranslate">(config)# stack</pre>
<p><strong>Change From Ethernet To Stack Mode</strong></p>
<pre class="brush: plain; title: ; notranslate">(config-stack)# stack-port 1/xg1 stack
(config-stack)# stack-port 1/xg2 stack
(config-stack)# exit</pre>
<p><strong>Verify New Stack Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate"># show stack-port
Configured  Running
Stack      Stack      Link       Link
Unit    Interface       Mode       Mode       Status     Speed (Gb/s)
---- ---------------- ---------- ---------- ------------ ------------
1    xg1              Stack   Ethernet   Link Down    Unknown
1    xg2              Stack   Ethernet   Link Down    Unknown
1    xg3              Ethernet   Ethernet   Link Down    Unknown
1    xg4              Ethernet   Ethernet   Link Down    Unknown    </pre>
<p>Once you are done with one wash, rinse, and repeat on the other switch(es), but one last thing to notice.  Here that we are showing two different modes, &#8220;configured stack mode&#8221; and &#8220;running stack mode&#8221; this is reflecting that we have made the configuration changes necessary to flip the modules over, but that the machine has not be rebooted so that it can reload its configuration.  So now when you have some downtime reboot the switches.  The first one that comes up will be the master and the second one will end up with a default configuration.  In our case the only configuration specific to our environment is jumbo frames.  Which can be configured switch wide.</p>
<p><strong>Enter Enable Mode</strong></p>
<pre class="brush: plain; title: ; notranslate">&gt; en</pre>
<p><strong>Enter Configuration Mode</strong></p>
<pre class="brush: plain; title: ; notranslate"># configure</pre>
<p><strong>Enter Interface Configuration Mode For All Ethernet Interfaces</strong></p>
<pre class="brush: plain; title: ; notranslate">(config)# interface range ethernet all</pre>
<p><strong>Enable Jumbo Frames</strong></p>
<pre class="brush: plain; title: ; notranslate">(config-if)# mtu 9216
(config-if)# exit</pre>
<p>Well that does it.  You now have a stacked Dell PowerConnect with Jumbo Frames enabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/02/dell-powerconnect-6224-stacking-module-dual-master/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iSCSI Initiator: OpenIndiana</title>
		<link>http://blog.allanglesit.com/2012/02/iscsi-initiator-openindiana/</link>
		<comments>http://blog.allanglesit.com/2012/02/iscsi-initiator-openindiana/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 12:00:56 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[iSCSI]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[comstar]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[lun]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[openindiana]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=885</guid>
		<description><![CDATA[Alot of my time is spent handling storage from the array side, however recently I had the need to test both sides of the process in order to perform some exclusionary tests against a fully adaptable environment, without impacting our production environments, so I ended up using OpenIndiana 151a on both the target and initator [...]]]></description>
				<content:encoded><![CDATA[<p>Alot of my time is spent handling storage from the array side, however recently I had the need to test both sides of the process in order to perform some exclusionary tests against a fully adaptable environment, without impacting our production environments, so I ended up using OpenIndiana 151a on both the target and initator side of the connection.  This is how you handle the initiator side of the connection.</p>
<p><strong>Identify the Initiator IQN</strong></p>
<p>First we need to identify the IQN of the iSCSI initiator, this is necessary to configure the security on the iSCSI target.</p>
<pre class="brush: plain; title: ; notranslate"># iscsiadm list initiator-node
Initiator node name: iqn.1986-03.com.sun:01:c0ca4ce904ff.4f45b957
Initiator node alias: openindiana
Login Parameters (Default/Configured):
Header Digest: NONE/-
Data Digest: NONE/-
Authentication Type: NONE
RADIUS Server: NONE
RADIUS Access: disabled
Tunable Parameters (Default/Configured):
Session Login Response Time: 60/-
Maximum Connection Retry Time: 180/-
Login Retry Time Interval: 60/-
Configured Sessions: 1</pre>
<p><strong>Configure iSCSI Static Discovery</strong></p>
<p>Here we configure the type of discovery that we want to use, in our case we are using static discovery.</p>
<pre class="brush: plain; title: ; notranslate"># iscsiadm modify discovery --static enable</pre>
<p>Here we add the actual discovery parameters, the IQN of the target, as well as the IP which we will connect to to create the connection.</p>
<pre class="brush: plain; title: ; notranslate"># iscsiadm add static-config iqn.2010-09.org.openindiana:02:1a7a530f-8508-4736-f269-d6363a8cb5e6,10.0.0.21:3260</pre>
<p><strong>View Available LUNs</strong></p>
<p>Now with everything working on both sides of the connection we will end up seeing specifics about our connection, and our available LUNs</p>
<pre class="brush: plain; title: ; notranslate"># iscsiadm list target -vS
Target: iqn.2010-09.org.openindiana:02:1a7a530f-8508-4736-f269-d6363a8cb5e6
Alias: -
TPGT: 1
ISID: 4000002a0000
Connections: 1
CID: 0
IP address (Local): 10.0.0.22:59749
IP address (Peer): 10.0.0.21:3260
Discovery Method: Static
Login Parameters (Negotiated):
Data Sequence In Order: yes
Data PDU In Order: yes
Default Time To Retain: 20
Default Time To Wait: 2
Error Recovery Level: 0
First Burst Length: 65536
Immediate Data: yes
Initial Ready To Transfer (R2T): yes
Max Burst Length: 262144
Max Outstanding R2T: 1
Max Receive Data Segment Length: 32768
Max Connections: 1
Header Digest: NONE
Data Digest: NONE

LUN: 0
Vendor:  OI
Product: COMSTAR
OS Device Name: /dev/rdsk/c4t600144F0B7EA490000004F471B750001d0s2</pre>
<p>Notice LUN 0 in the above output.  This is our LUN, remember if you expose multiple LUNs then you will see multiple LUNs here, this is not yet a usable disk for that we will need to use the format utility to identify the disk name.</p>
<pre class="brush: plain; title: ; notranslate"># format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c3t0d0 &amp;lt;ATA-WDCWD5003ABYX-1-1S02 cyl 60798 alt 2 hd 255 sec 63&amp;gt;
/pci@0,0/pci1028,4dd@1f,2/disk@0,0
1. c4t600144F0B7EA490000004F471B750001d0 &amp;lt;OI-COMSTAR-1.0 cyl 1303 alt 2 hd 255 sec 63&amp;gt;
/scsi_vhci/disk@g600144f0b7ea490000004f471b750001</pre>
<p>We now have a completed iSCSI session, and we have a usable volume on our client side.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/02/iscsi-initiator-openindiana/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adventures in ZFS: Configuring iSCSI Targets</title>
		<link>http://blog.allanglesit.com/2012/02/adventures-in-zfs-configuring-iscsi-targets/</link>
		<comments>http://blog.allanglesit.com/2012/02/adventures-in-zfs-configuring-iscsi-targets/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 12:00:53 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[iSCSI]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[ZFS]]></category>
		<category><![CDATA[adventures in zfs]]></category>
		<category><![CDATA[comstar]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[lun]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[openindiana]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[solaris11]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[zfs]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=876</guid>
		<description><![CDATA[The most critical thing about any storage implementation is flexibility.  This means that you need to be able to adapt your solution to changing environmental considerations.  The nice thing about a ZFS-based solution is that all of the building blocks are available.  If you want to use it as a NAS device, you can use [...]]]></description>
				<content:encoded><![CDATA[<p>The most critical thing about any storage implementation is flexibility.  This means that you need to be able to adapt your solution to changing environmental considerations.  The nice thing about a ZFS-based solution is that all of the building blocks are available.  If you want to use it as a NAS device, you can use CIFS, NFS.  If you want to provision Fibre Channel that is available too.  Even some of the more sought after SAN features are included, replication, deduplication, thin-provisioning, and many more.  Now in todays article we are going to discuss how you can go about setting up iSCSI targets.  I personally am not a fan of iSCSI (I have been bitten by the hard knee too many times), however you really can&#8217;t argue with the flexibility that is provided by being able to quickly provision storage on already existing or readily available hardware.  The best thing about this process is that it is really similar to provisioning fibre channel targets, so if you are familiar with this process (<a title="Adventures in ZFS: Configuring Fibre Channel Targets" href="http://blog.allanglesit.com/2011/08/adventures-in-zfs-configuring-fibre-channel-targets/">available here</a>) then you will be able to quickly adapt to the iSCSI variation.</p>
<p>I did my testing on OpenIndiana 151a, which had up to date packages as of Feb 23, 2012.  The process should be largely similar if not the same on Solaris 11 Express and Solaris 11 GA.</p>
<p><strong>Install Prequisite Packages</strong></p>
<pre class="brush: plain; title: ; notranslate"># pkg install network/iscsi/target</pre>
<p><strong>Start SCSI Target Mode Framework Service</strong></p>
<pre class="brush: plain; title: ; notranslate"># svcadm enable svc:/system/stmf:default</pre>
<p><strong>Start iSCSI Target Service</strong></p>
<pre class="brush: plain; title: ; notranslate"># svcadm enable svc:/network/iscsi/target:default</pre>
<p><strong>Display the Status of the SCSI Target Service</strong></p>
<p>The ALUA Status is what allows a LUN to be served via FC and iSCSI at the same time.  We do not require or want it.</p>
<pre class="brush: plain; title: ; notranslate"># stmfadm list-state
Operational Status: online
Config Status     : initialized
ALUA Status       : disabled
ALUA Node         : 0</pre>
<p><strong>Create a File System (Volume) to be Provisioned</strong></p>
<p>Before we can present a LUN then we need to create a ZFS file system as a volume so that it can be used as a block device.</p>
<pre class="brush: plain; title: ; notranslate"># zfs create -V 10G rpool/testvol</pre>
<p>Notice the lack of a mount point, this is due to provisioning the file system as a volume.</p>
<pre class="brush: plain; title: ; notranslate"># zfs list rpool/testvol
NAME            USED  AVAIL  REFER  MOUNTPOINT
rpool/testvol  10.3G   436G    16K  -</pre>
<p><strong>Create a LUN for the Volume</strong></p>
<p>So we have created a volume, now we need to make the STMF aware of it, so that it can hand it out as a block device, and thus it can be used.</p>
<pre class="brush: plain; title: ; notranslate"># sbdadm create-lu /dev/zvol/rdsk/rpool/testvol
Created the following LU:

GUID                    DATA SIZE           SOURCE
--------------------------------  -------------------  ----------------
600144f0b7ea490000004f471b750001  10737418240          /dev/zvol/rdsk/rpool/testvol</pre>
<p>We will need the path and the name of the LUN, which is available from the create-lu command (as GUID and SOURCE), however stmfadm gives us a more readable format.</p>
<pre class="brush: plain; title: ; notranslate"># stmfadm list-lu -v
LU Name: 600144F0B7EA490000004F471B750001
Operational Status: Online
Provider Name     : sbd
Alias             : /dev/zvol/rdsk/rpool/testvol
View Entry Count  : 0
Data File         : /dev/zvol/rdsk/rpool/testvol
Meta File         : not set
Size              : 10737418240
Block Size        : 512
Management URL    : not set
Vendor ID         : OI
Product ID        : COMSTAR
Serial Num        : not set
Write Protect     : Disabled
Writeback Cache   : Enabled
Access State      : Active</pre>
<p><strong>Create an iSCSI Qualified Name (iqn) Target</strong></p>
<p>This simply creates the target iqn for the machine we will be serving out iSCSI volumes from.</p>
<pre class="brush: plain; title: ; notranslate"># itadm create-target
Target iqn.2010-09.org.openindiana:02:1a7a530f-8508-4736-f269-d6363a8cb5e6 successfully created</pre>
<p><strong>Put the New Target in Offline Mode</strong></p>
<p>In order to add the target to the target group we will be creating (to control storage views) then we must offline our target first.</p>
<pre class="brush: plain; title: ; notranslate"># stmfadm offline-target iqn.2010-09.org.openindiana:02:1a7a530f-8508-4736-f269-d6363a8cb5e6</pre>
<p><strong>Create a Target Group</strong></p>
<p>This the group which will control the target side of the storage connection, so in other words it is on your array, and I like to name it as such, so if your array were named &#8220;array001&#8243; then I would name your target group that.</p>
<pre class="brush: plain; title: ; notranslate"># stmfadm create-tg array001</pre>
<p><strong>Add the Target to the Target Group</strong></p>
<pre class="brush: plain; title: ; notranslate"># stmfadm add-tg-member -g array001 iqn.2010-09.org.openindiana:02:1a7a530f-8508-4736-f269-d6363a8cb5e6</pre>
<p><strong>Review the Target Group Configuration</strong></p>
<pre class="brush: plain; title: ; notranslate"># stmfadm list-tg -v
Target Group: array001
Member: iqn.2010-09.org.openindiana:02:1a7a530f-8508-4736-f269-d6363a8cb5e6</pre>
<p><strong>Create a Host Group</strong></p>
<p>This is the group which will identify where the traffic is coming from, so for organization I like to have it named to reflect the server name of the initiator side of the connection.  So if your server was &#8220;server001&#8243; then I would name your host group to match that, this will help keep things nice and tidy and make your views much more legible.</p>
<pre class="brush: plain; title: ; notranslate"># stmfadm create-hg server001</pre>
<p><strong>Add the Host to the Host Group</strong></p>
<p>Here you will need to get the iqn of the client side of the storage connector and insert it into this command.</p>
<pre class="brush: plain; title: ; notranslate"># stmfadm add-hg-member -g server001 iqn.1986-03.com.sun:01:c0ca4ce904ff.4f45b957</pre>
<p><strong>Create a View</strong></p>
<p>A view is what ties together everything, we take the target group, the host group, and the LUN and put them in a view.  If the connection does not meet the first two criteria then it does not get to see the LUN.  This is important in the event that you have multiple servers accessing your array (which you will).  You don&#8217;t want to end up with multiple servers writing to the same LUNs at the same time without certain precautions being taken first, so we want to block that behavior.</p>
<pre class="brush: plain; title: ; notranslate"># stmfadm add-view -t array001 -h server001 600144F0B7EA490000004F471B750001</pre>
<p><strong>Create a Target Portal Group</strong></p>
<p>The Target Portal Group is what the initator actually connects to in order to find the storage.  Here we need to use the storage IP on array001.</p>
<pre class="brush: plain; title: ; notranslate"># itadm create-tpg array001portal 10.0.0.21:3260</pre>
<p><strong>Enable Static Mode Discovery</strong></p>
<pre class="brush: plain; title: ; notranslate"># devfsadm -i iscsi</pre>
<p>At this point once you have configured your iSCSI initiator on the client side then you should be able to see your iSCSI block device.</p>
<p>That wraps it up.  Put a neat little bow on it and send it on its way.</p>
<p>A few things to remember with iSCSI and your ZFS box.  You will need a mirrored ZIL (mirrored because you don&#8217;t want to lose data) to counteract the performance penalties associated with synchronous writes.  The most important thing is that iSCSI is a protocol that is suited towards flexibility but not performance.  If you need performance you should be considering fibre channel, remember a good chunk of the cost comes from the fabric, if you already have the fabric for another SAN you can easily connect another array into the existing fabric, remember it is Storage Area NETWORK.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/02/adventures-in-zfs-configuring-iscsi-targets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adventures in ZFS: Storage Sizing</title>
		<link>http://blog.allanglesit.com/2012/02/adventures-in-zfs-storage-sizing/</link>
		<comments>http://blog.allanglesit.com/2012/02/adventures-in-zfs-storage-sizing/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 12:00:35 +0000</pubDate>
		<dc:creator>matthew.mattoon</dc:creator>
				<category><![CDATA[General Information]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[ZFS]]></category>
		<category><![CDATA[adventures in zfs]]></category>
		<category><![CDATA[planning]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[storage sizing]]></category>
		<category><![CDATA[zfs]]></category>

		<guid isPermaLink="false">http://blog.allanglesit.com/?p=854</guid>
		<description><![CDATA[One of the most complex parts of storage in general and ZFS in particular is correctly assessing the amount and types of storage that you will need to meet your requirements.  You can of course just purchase what you can afford and hope for the best.  But after reading this article you can relatively easily [...]]]></description>
				<content:encoded><![CDATA[<p>One of the most complex parts of storage in general and ZFS in particular is correctly assessing the amount and types of storage that you will need to meet your requirements.  You can of course just purchase what you can afford and hope for the best.  But after reading this article you can relatively easily determine approximately how much storage you should plan for based on a few factors from your existing environment, this article will primarily focus on ZFS, however alot of this is true in other storage platforms as well&#8230;</p>
<p><strong>Factor One &#8211; Use Case</strong></p>
<p>The use case is the single most important factor, this basically tells you how you plan on using the data.  Is this going to serve files (NFS or CIFS), will you be using it to serve block devices (Fibre Channel or iSCSI), or perhaps you will be using this as a consolidation point of multiple sources of data for use in a backup scenario.  The answer to this question will primarily determine if you are using a ZIL or Cache device or if you are using spares.  This of course will steal slots (where disks could go) so you will want to factor that into your larger capacity planning.</p>
<p><em>Physical Capacity</em></p>
<p>Obviously the machine that you buy will have a limit to how many disks you can fit in it.  After that you can plan on adding expansion chassis.  You need to make sure you understand how your zpools will be formatted and the types of disks that you will be using so that you can begin to see how much data you will be able to squeeze onto the spindles.  One easy thing to overlook is the need for drive bays for other purposes (spares, log, cache, system drives, etc).  If you plan on expanding with an additional chassis, will you use up all of your expansion slots with various cards (10Gb, FibreChannel, NICs, SSD, etc).  Also when considering disks you need to keep in mind that capacity is not the only metric to consider.  You also need to keep in mind that your workload will determine how performant the solution must be to meet requirements, for example a backup server will not require the same performance as a storage head which is handing out block devices which have Operating Systems installed on them (read: Virtual Machine environments).</p>
<p><em>Spare Devices</em></p>
<p>Depending on your use case you might need to consider allocating some drives as spares to allow you the time to procure and/or replace failed drives.  This will simply protect you from additional failure(s).  If you have the space I like to have 1 spare per 12-15 acting as a spare.  This really straight forward, just make sure that as part of any large system that the company accepts the risks involved with your decision, if they are not willing to accept the risks then provide them with an option which will protect them from that risk.  They will then either pay for the lower risk system or accept the risk of the cheaper system.</p>
<p><em>Cache Devices</em></p>
<p>Cache devices (L2ARC) is a really quick and cheap way to increase your read iops on a system wide basis.  Basically as data is read off of ZFS it is read through the cache device, then when subsequent read requests for the data come in then they can be served directly off of the cache, this works in combination with the ARC which is where all of your memory goes in ZFS.  Now a cache device is really necessary if you are using deduplication.  When you enable deduplication all subsequently written files are indexed into the dedup table, before a write can be committed it must be compared to items that are already in the dedup table (to see if anything else is the same &#8211; thus if it should actually be written to disk or if a pointer to the previously existing file will exist) initially this will not pose a problem as your dedupe table will be relatively small and it can be stored in the 25% of the ARC that it is relegated to.  However at some point you will run out of space in the ARC and if you do not have a L2ARC then your dedup table will be swapped which of course means that it will be holding up writes to disk, in other words it will be slow.  Since a cache device&#8217;s purpose is to speed up reads, then you want to look for a SSD which is slanted towards better performance on the read side.  I like Crucial M4 for this purpose, but please keep in mind they had a <a title="Adventures in ZFS: Crucial M4 Firmware SMART Issue" href="http://blog.allanglesit.com/2012/01/adventures-in-zfs-crucial-m4-firmware-smart-issue/" target="_blank">serious firmware bug</a> in a previous version so make sure you end up with v0309 on the disk and update to it if you don&#8217;t.</p>
<p><em>Log Devices</em></p>
<p>Log devices (ZFS Intent Log) is a really cool way to speed up technologies which utilize synchronous writes.  Synchronous writes are used to ensure that data is committed to the disk before additional data is sent, it essentially serializes the connection.  Most commonly you will find synchronous writes in databases, NFS and iSCSI.  So if you are planning on using one of these technologies then you will want to consider using a mirrored ZIL device.  Now I am sure someone out there is saying, &#8220;Whoa mirrored?  But that takes up two slots man&#8230;&#8221; and you would be correct, however keep in mind that if you have a failure of your ZIL, you have actual data committed to it which has not been committed to disk (read: data loss).  As such you really ought to have a mirrored ZIL or none at all, you can also stack multiple mirrors as a ZIL if you had a higher synchronous writes workload.  Since log devices are meant to improve writes (albeit a certain type of write) then you will want to look for a SSD which is slanted towards better write performance.  I tend to like OCZ Vertex 3 for this purpose.</p>
<p><strong>Factor Two &#8211; Data Growth</strong></p>
<p>Now we get into actually sizing data.  When you try to project growth you need to make sure that (1) you take use an appropriately sized sample set of data (2) factor in any relevant business or technical factors which could have skewed your sample.  I like to size my storage based off of backup size.  Simply grab the size of your full backups for the data in question, if you are going to use this to serve block devices collecting this data becomes a bit more complex, because now you are talking more of a machine sprawl type of growth which can be harder to account for.  Here is are a few formulas to get you started (make sure you are using the same metric, i.e. B, KB, MB, GB, TB).</p>
<p><em>Calculate Weekly Growth</em></p>
<pre class="brush: plain; title: ; notranslate">
(full_week1 - full_week0) = growth_week1
(full_week2 - full_week1) = growth_week2
</pre>
<p><em>Calculate Weekly Growth Rate</em></p>
<pre class="brush: plain; title: ; notranslate">
(growth_week1 / full_week0) = growth_rate_week1
</pre>
<p><em>Average Weekly Growth</em></p>
<pre class="brush: plain; title: ; notranslate">
(growth_week1 + growth_week2 + growth_week3 + growth_week4) / number_of_weeks = average_weekly_growth
</pre>
<p><em>Average Weekly Growth Rate</em></p>
<pre class="brush: plain; title: ; notranslate">
(growth_rate_week1 + growth_rate_week2 + growth_rate_week3 + growth_rate_week4) / number_of_weeks = average_weekly_growth_rate
</pre>
<p><em>Annualized Weekly Growth</em></p>
<pre class="brush: plain; title: ; notranslate">
(average_weekly_growth * 53) = annual_growth
</pre>
<p>So for example if we start with this example&#8230;</p>
<table border="0" frame="VOID" rules="NONE" cellspacing="0">
<colgroup>
<col width="86" />
<col width="86" />
<col width="160" /></colgroup>
<tbody>
<tr>
<td align="LEFT" width="86" height="17">week0</td>
<td align="RIGHT" width="86">100</td>
<td align="LEFT" width="160"></td>
</tr>
<tr>
<td align="LEFT" height="17">week1</td>
<td align="RIGHT">105</td>
<td align="LEFT"></td>
</tr>
<tr>
<td align="LEFT" height="17">week2</td>
<td align="RIGHT">120</td>
<td align="LEFT"></td>
</tr>
<tr>
<td align="LEFT" height="17">week3</td>
<td align="RIGHT">122</td>
<td align="LEFT"></td>
</tr>
<tr>
<td align="LEFT" height="17">week4</td>
<td align="RIGHT">122</td>
<td align="LEFT"></td>
</tr>
<tr>
<td align="LEFT" height="17">week5</td>
<td align="RIGHT">118</td>
<td align="LEFT">data expired</td>
</tr>
<tr>
<td align="LEFT" height="17">week6</td>
<td align="RIGHT">130</td>
<td align="LEFT">added new servers</td>
</tr>
<tr>
<td align="LEFT" height="17">week7</td>
<td align="RIGHT">135</td>
<td align="LEFT"></td>
</tr>
<tr>
<td align="LEFT" height="17">week8</td>
<td align="RIGHT">136</td>
<td align="LEFT"></td>
</tr>
</tbody>
</table>
<p>Notice that in this example we have a couple of points where I saw it fit to make notes.  One was when our dataset decreased and the other was when it grew sharper than the trend up to that point.  I made these notes because I wanted to point out that if you had a very large deviation then you might want to make some sort of adjustment so as to not skew your results.  In this case both of these happened because of regular course of business so they should be legitimately considered as part of the growth curve.  However if you had some sort of failure in your backups that you were already accounting for that data in another way you would not want to double count it if it came back into the backups in the middle of your sample.</p>
<p><em>Weekly Growth</em></p>
<pre class="brush: plain; title: ; notranslate">
week1 (105 - 100) = 5
week2 (120 - 105) = 15
week3 (122 - 120) = 2
week4 (122 - 122) = 0
week5 (118 - 122) = -4
week6 (130 - 118) = 12
week7 (135 - 130) = 5
week8 (136 - 135) = 1
</pre>
<p><em>Weekly Growth Rate</em></p>
<pre class="brush: plain; title: ; notranslate">
week1 (5 / 100) = .05 = 5%
week2 (15 / 105) = .143 = 14.3%
week3 (2 / 120) = .017 = 1.7%
week4 (0 / 122) = 0 = 0%
week5 (-4 / 122) = -.033 = -3.3%
week6 (12 / 118) = .102 = 10.2%
week7 (5 / 130) = .039 = 3.9%
week8 (1 / 135) = .007 = .7%
</pre>
<p><em>Average Weekly Growth</em></p>
<pre class="brush: plain; title: ; notranslate">
(5 + 15 + 2 + 0 + -4 + 12 + 5 + 1) / 8 = 4.5
</pre>
<p><em>Average Weekly Growth Rate</em></p>
<pre class="brush: plain; title: ; notranslate">
(5 + 14.3 + 1.7 + 0 + -3.3 + 10.2 + 3.9 + .7) / 8 = 4.1%
</pre>
<p><em>Annualized Growth</em></p>
<pre class="brush: plain; title: ; notranslate">
(4.5 * 53) = 238.5
</pre>
<p>Now as you can see from this example the numbers add up quickly, in a year we have easily doubled our dataset, now why is this important?  Basically most businesses perform budgeting at the beginning of the year and as such expenses need to be planned out, and any expansion that you do perform will need to _at least_ last through the year, either way you at least need to know how long you can reasonably expect to be able to use this hardware in its capacity before having to look for upgrades.  Your project will be generally regarded as successful if it meets the technical requirements with minimal involvement from the business (having to ask for more money), especially if you can tell them that this storage will need to be expanded in x number of months.</p>
<p><strong>Factor Three &#8211; Data Churn</strong></p>
<p>Churn is freaking scary when it comes to calculating capacity requirements.  Churn is the amount of data change, now some churn is actually growth so we will want to keep that in mind when we are performing our analysis, however churn is the amount of data that changes in a given week. It is amazing the levels of churn that some companies have.  This is especially disconcerting if you plan on utilizing snapshots or send/receive as a form of backup.  Now we still use backups to calculate churn, however instead we will use our mid-week backups instead of our fulls.  Now if you are using incremental backups then you will total all of those during the week to get your dataset size.  If you are using differentials you can calculate this using the final differential in the week.</p>
<p>Now the tricky thing about churn is that growth is churn, but churn is not growth.  So after we calculate our growth and our churn we will subtract our growth from our churn to get our actual churn, otherwise we will be double counting our growth.  I don&#8217;t bother doing this until we are talking about the averages and the annualized numbers.  You will notice that these formulas are largely the same as the growth formulas, just remember her that you need to calculate these against your aggregated incrementals or your final differential to get valid numbers.</p>
<p><em>Calculate Weekly Churn (differentials)<br />
</em></p>
<pre class="brush: plain; title: ; notranslate">
diff_week1 = churn_week1
</pre>
<p><em>Calculate Weekly Churn (incrementals)</em></p>
<pre class="brush: plain; title: ; notranslate">
(inc1_week1 + inc2_week1 + inc3_week1 + inc4_week1 + inc5_week1) = churn_week1
</pre>
<p><em>Calculate Weekly Churn Rate</em></p>
<pre class="brush: plain; title: ; notranslate">
(churn_week1 / full_week0) = churn_rate_week1
</pre>
<p><em>Average Weekly Churn</em></p>
<pre class="brush: plain; title: ; notranslate">
(churn_week1 + churn_week2 + churn_week3 + churn_week4) / number_of_weeks = average_weekly_churn
</pre>
<p><em>Average Weekly Churn Rate</em></p>
<pre class="brush: plain; title: ; notranslate">
(churn_rate_week1 + churn_rate_week2 + churn_rate_week3 + churn_rate_week4) / number_of_weeks = average_weekly_churn_rate
</pre>
<p><em>Annualized Weekly Churn</em></p>
<pre class="brush: plain; title: ; notranslate">
(average_churn_growth * 53) = annual_churn
</pre>
<p>Expanding on our previous example, if we had churn rates that looked like this&#8230;</p>
<table border="0" frame="VOID" rules="NONE" cellspacing="0">
<colgroup>
<col width="86" />
<col width="86" /></colgroup>
<tbody>
<tr>
<td align="LEFT" width="86" height="17">week1</td>
<td align="RIGHT" width="86">8</td>
</tr>
<tr>
<td align="LEFT" height="17">week2</td>
<td align="RIGHT">6</td>
</tr>
<tr>
<td align="LEFT" height="17">week3</td>
<td align="RIGHT">5</td>
</tr>
<tr>
<td align="LEFT" height="17">week4</td>
<td align="RIGHT">2</td>
</tr>
<tr>
<td align="LEFT" height="17">week5</td>
<td align="RIGHT">2</td>
</tr>
<tr>
<td align="LEFT" height="17">week6</td>
<td align="RIGHT">15</td>
</tr>
<tr>
<td align="LEFT" height="17">week7</td>
<td align="RIGHT">6</td>
</tr>
<tr>
<td align="LEFT" height="17">week8</td>
<td align="RIGHT">1</td>
</tr>
</tbody>
</table>
<p><em>Weekly Churn Rate</em></p>
<pre class="brush: plain; title: ; notranslate">
week1 (8 / 100) = .08 = 8%
week2 (6 / 105) = .057 = 5.7%
week3 (5 / 120) = .042 = 4.2%
week4 (2 / 122) = .016 = 1.6%
week5 (2 / 122) = .016 = 1.6%
week6 (15 / 118) = .127 = 12.7%
week7 (6 / 130) = .046 = 4.6%
week8 (1 / 135) = .007 = .7%
</pre>
<p><em>Average Weekly Churn</em></p>
<pre class="brush: plain; title: ; notranslate">
(8 + 6 + 5 + 2 + 2 + 15 + 6 + 1) / 8 = 5.6
</pre>
<p>Now this is only partly correct, we still need to account for the growth we have already included  by subtracting the average growth from our average churn.</p>
<pre class="brush: plain; title: ; notranslate">
(5.6 - 4.5) = 1.1
</pre>
<p>Giving us a growth-adjusted weekly average churn of 1.1.</p>
<p><em>Average Weekly Churn Rate</em></p>
<pre class="brush: plain; title: ; notranslate">
(8 + 5.7 + 4.2 + 1.6 + 1.6 + 12.7 + 4.6 + .7) / 8 = 4.9%
</pre>
<p>Again we must remove our growth.</p>
<pre class="brush: plain; title: ; notranslate">
(4.9 - 4.5) = 0.4
</pre>
<p>Giving us a growth-adjusted weekly average churn of 0.4%</p>
<p><em>Annualized Churn</em></p>
<pre class="brush: plain; title: ; notranslate">
(1.1 * 53) = 58.3
</pre>
<p>Now that we have calculated our storage needs we can start to work out our final configurations based on the goals of our project.  In our example case we have learned that based on our current dataset (136) and our annualized growth (58.3), which means that in 1 year our dataset will increase by 30% which means that if we had a goal of engineering a system which would not need any upgrades (based on current use cases) in the first two years then you would need a minimum size of 252.6.</p>
<p>Now one final consideration when sizing ZFS is pool capacity, ZFS uses copy on write to turn random writes into sequential writes, this is very good for performance, however when a pool exceeds 80% ZFS will not be able to do this as well and as such your writes will become semi-random (since parts of files will have to be written in non-sequential blocks that happen to be free).  So we should also make sure that we have a 20% ceiling on our projections so that we can ensure the same level of performance throughout the systems life.  And with that we have a final number of 303.1.</p>
<p>Now please keep in mind, these formulas will allow you to work through your own sizing exercise, but I am not suggesting that you have a growth rate of 4.5% and a churn rate of 1.1% this was merely an example, you will need to use your own numbers to come up with projections which are applicable to your scenario.  Also you will notice that in my example I did not use a size metric (MB, GB, TB, PB) I did this intentionally so as to not confuse you these formulas will work regardless of your metric, just ensure you use the same metric in all of your calculations.</p>
<p>Happy Sizing!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allanglesit.com/2012/02/adventures-in-zfs-storage-sizing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.allanglesit.com/feed/ ) in 4.44097 seconds, on May 23rd, 2013 at 3:17 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on May 23rd, 2013 at 4:17 pm UTC -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- Quick Cache Is Fully Functional :-) ... A Quick Cache file was just served for (  blog.allanglesit.com/feed/ ) in 0.00235 seconds, on May 23rd, 2013 at 3:30 pm UTC. -->