<?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>Xi Group Ltd. Company Blog &#187; Xi Group Ltd. Company Blog &#187; volumes</title>
	<atom:link href="http://blog.xi-group.com/tag/volumes/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xi-group.com</link>
	<description>High-quality DevOps Services</description>
	<lastBuildDate>Tue, 09 Jun 2015 11:38:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.2</generator>
	<item>
		<title>Small Tip: How to use &#8211;block-device-mappings to manage instance volumes with AWS CLI</title>
		<link>http://blog.xi-group.com/2014/11/small-tip-how-to-use-block-device-mappings-to-manage-instance-volumes-with-aws-cli/</link>
		<comments>http://blog.xi-group.com/2014/11/small-tip-how-to-use-block-device-mappings-to-manage-instance-volumes-with-aws-cli/#comments</comments>
		<pubDate>Wed, 26 Nov 2014 10:18:37 +0000</pubDate>
		<dc:creator><![CDATA[Ivo Vachkov]]></dc:creator>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Operations]]></category>
		<category><![CDATA[Small Tip]]></category>
		<category><![CDATA[AWS CLI]]></category>
		<category><![CDATA[block device mappings]]></category>
		<category><![CDATA[instance store]]></category>
		<category><![CDATA[volumes]]></category>

		<guid isPermaLink="false">http://blog.xi-group.com/?p=195</guid>
		<description><![CDATA[This post will present one of the less popular features in the AWS CLI tool set, how to deal with EC2 instance volumes through the use of &#8211;block-device-mappings parameter. Previous post, Small Tip: Use AWS CLI to create instances with bigger root partitions already presents one of the common use cases, modifying the instance root [&#8230;]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">This post will present one of the less popular features in the AWS CLI tool set, how to deal with EC2 instance volumes through the use of <strong>&#8211;block-device-mappings</strong> parameter. Previous post, <a href="http://blog.xi-group.com/2014/06/small-tip-use-aws-cli-to-create-instances-with-bigger-root-partitions/">Small Tip: Use AWS CLI to create instances with bigger root partitions</a> already presents one of the common use cases, modifying the instance root partition size. However, use of &#8216;&#8211;block-device-mappings&#8217; can go far beyond this simple feature.</p>
<p style="text-align: justify;">Default documentation (<a href="http://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html">http://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html</a>) although a good start is somewhat limited. Several tips and tricks will be presented here.</p>
<p><strong>The location of the JSON block device mapping specification can be quite flexible. The mappings can be supplied:</strong></p>
<p>1. Using command line directly:</p><pre class="crayon-plain-tag">--block-device-mappings '[ {"DeviceName":"/dev/sdb","VirtualName":"ephemeral0"}, {"DeviceName":"/dev/sdc","VirtualName":"ephemeral1"}]'</pre><p></p>
<p>2. Using file as a source:</p><pre class="crayon-plain-tag">--block-device-mappings file:////home/ec2-user/mapping.json</pre><p></p>
<p>3. Using URL as a source:</p><pre class="crayon-plain-tag">--block-device-mappings http://mybucket.s3.amazonaws.com/mapping.json</pre><p></p>
<p>Source: <a href="http://understeer.hatenablog.com/entry/2013/10/18/223618">http://understeer.hatenablog.com/entry/2013/10/18/223618</a></p>
<p>Other common scenarios:</p>
<p>1. <strong>To reorder default ephemeral volumes to ensure stability of the environment</strong>:</p><pre class="crayon-plain-tag">[
  {
    "DeviceName": "/dev/sde",
    "VirtualName": "ephemeral0"
  },
  {
    "DeviceName": "/dev/sdf",
    "VirtualName": "ephemeral1"
  }
]</pre><p></p>
<p style="text-align: justify;"><strong>NOTE</strong>: Useful for additional UserData processing or deployments with hardcoded settings.</p>
<p>2. <strong>To allocate additional EBS Volume with specific size (100GB), to be associated with the EC2 instance</strong>:</p><pre class="crayon-plain-tag">[
  {
    "DeviceName": "/dev/sdg",
    "Ebs": {
      "VolumeSize": 100
    }
  }
]</pre><p></p>
<p style="text-align: justify;"><strong>NOTE</strong>: Useful for cases where cheaper instance types are outfitted with big volumes (Disk intensive tasks run on low-CPU/MEM instance types).</p>
<p>3. <strong>To allocate new volume from Snapshot ID</strong>:</p><pre class="crayon-plain-tag">[
  {
    "DeviceName": "/dev/sdh",
    "Ebs": {
      "SnapshotId": "snap-xxxxxxxx"
    }
  }
]</pre><p></p>
<p style="text-align: justify;"><strong>NOTE</strong>: Useful to pre-loading newly created instances with specific disk data and still retaining the ability to modify the local copy.</p>
<p>4. <strong>To omit mapping of a particular Device Name</strong>:</p><pre class="crayon-plain-tag">[
  {
    "DeviceName": "/dev/sdj",
    "NoDevice": ""
  }
]</pre><p></p>
<p style="text-align: justify;"><strong>NOTE</strong>: Useful to overwrite default AWS behavior.</p>
<p>5. <strong>To allocate new EBS Volume with explicit termination behavior (Keep after instance termination)</strong>:</p><pre class="crayon-plain-tag">[
  {
    "DeviceName": "/dev/sdc",
    "Ebs": {
      "VolumeSize": 10,
      "DeleteOnTermination": false
    }
  }
]</pre><p></p>
<p style="text-align: justify;"><strong>NOTE</strong>: Useful to keep instance data after termination, additional cost may be significant if those volumes are not released after examination.</p>
<p>6. <strong>To allocate new, encrypted, EBS Volume with Reserved IOPS</strong>:</p><pre class="crayon-plain-tag">[
  {
    "DeviceName": "/dev/sdc",
    "Ebs": {
      "VolumeSize": 10,
      "VolumeType": "io1",
      "Iops": 1000,
      "Encrypted": true
    }
  }
]</pre><p></p>
<p style="text-align: justify;"><strong>NOTE</strong>: Useful to set minimum required performance levels (I/O Operations Per Second) for the specified volume.</p>
<p style="text-align: justify;">Outlined functionality should cover wide range of potentially use cases for DevOps engineers who want to use automation to customize their infrastructure. Flexible instance volume management is a key ingredient for successful implementation of the &#8216;Infrastructure-as-Code&#8217; paradigm!</p>
<p>References</p>
<ul>
<li><a href="http://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html">http://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html</a></li>
<li><a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html">http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html</a></li>
<li><a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-blockdev-mapping.html">http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-blockdev-mapping.html</a></li>
<li><a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html">http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html</a></li>
<li><a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html">http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html</a></li>
</ul>
<div class="rpbt_shortcode">
<h3>Related Posts</h3>
<ul>
					
			<li><a href="http://blog.xi-group.com/2015/02/how-to-deploy-single-node-hadoop-setup-in-aws/">How to deploy single-node Hadoop setup in AWS</a></li>
					
			<li><a href="http://blog.xi-group.com/2015/01/userdata-teplate-for-ubuntu-14-04-ec2-instances-in-aws/">UserData Template for Ubuntu 14.04 EC2 Instances in AWS</a></li>
					
			<li><a href="http://blog.xi-group.com/2015/01/small-tip-how-to-use-aws-cli-filter-parameter/">Small Tip: How to use AWS CLI &#8216;&#8211;filter&#8217; parameter</a></li>
					
			<li><a href="http://blog.xi-group.com/2014/07/how-to-implement-multi-cloud-deployment-for-scalability-and-reliability/">How to implement multi-cloud deployment for scalability and reliability</a></li>
					
			<li><a href="http://blog.xi-group.com/2014/07/small-tip-how-to-use-aws-cli-to-start-spot-instances-with-userdata/">Small Tip: How to use AWS CLI to start Spot instances with UserData</a></li>
			</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.xi-group.com/2014/11/small-tip-how-to-use-block-device-mappings-to-manage-instance-volumes-with-aws-cli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
