tag:blogger.com,1999:blog-3222676459282878362024-02-08T08:28:55.269-08:00I'm just sayingAnonymoushttp://www.blogger.com/profile/03579029825538865886noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-322267645928287836.post-89458427127198541112015-07-16T09:00:00.003-07:002015-07-16T09:07:22.272-07:00Volume attach code flow in Cinder<br />
<br />
<br />
<header class="entry-header" style="box-sizing: border-box; color: #444444; font-family: Merriweather, Georgia, 'Times New Roman', serif; font-size: 18px; line-height: 30px;"><h1 class="entry-title" style="border: 0px; box-sizing: border-box; clear: both; font-family: inherit; font-size: 2.61111em; font-style: inherit; font-weight: inherit; line-height: 1.26383em; margin: 30px 0px; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline;">
OpenStack Cinder – Volume Attach flow</h1>
</header><br />
<div class="entry-content" style="border: 0px; box-sizing: border-box; font-family: Merriweather, Georgia, 'Times New Roman', serif; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<h2 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 29px; font-style: inherit; font-weight: inherit; line-height: 1.02414em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Intro</span></h2>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
Something that comes up fairly often in IRC, is “how does attach work”? From a Cinder perspective the code path is fairly simple, but it seems to throw people for a loop. So, I figured why not take a look at the reference implementation and walk through the steps of volume attach from the Cinder side.</div>
<h2 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 29px; font-style: inherit; font-weight: inherit; line-height: 1.02414em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Our Reference</span></h2>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
The Cinder project includes a reference driver, so we’ll use that as our reference here to walk through the code. The reference driver is built in Cinder using a combination of LVM and iSCSI targets (tgt-adm or LIO most commonly). As with everything in OpenStack you have choices, we’re just going to focus on the default options here, thick provisioned LVM and TgtAdm for the iSCSI component. We’re also using the default libvirt/KVM config on our Nova side.</div>
<h2 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 29px; font-style: inherit; font-weight: inherit; line-height: 1.02414em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">A few high level details</span></h2>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
It’s important to understand that most of the work with respect to attaching a volume is done on the Nova side. Cinder is mostly just responsible for providing a volumes information to Nova so that it can make an iSCSI attach on the Compute Node.</div>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
The communication path between Nova and Cinder is done via the cinderclient, the same cinderclient a command line user accesses; however Nova uses a special policy that allows it to access some details about a volume that regular users can’t, as well as a few calls you might not have seen before.</div>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
So what we’re going to do is look at an OpenStack deployment that has a volume ready to go (available) and an Instance that’s up and ready. We’ll focus on the calls from Nova to Cinder and Cinders response. In a follow up post we’ll dig into what’s happening on the Nova side.</div>
<h2 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 29px; font-style: inherit; font-weight: inherit; line-height: 1.02414em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Process flow</span></h2>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
As I mentioned, things on the Cinder side are rather simple. The attach process is just three calls to Cinder:</div>
<ol style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin: 0px 0px 30px 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">reserve_volume</li>
<li style="border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">intialize_connection</li>
<li style="border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">attach</li>
</ol>
<h3 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 23px; font-style: inherit; font-weight: inherit; line-height: 1.2913em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">reserve_volume(self, context, volume)</span></h3>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;">
<em style="border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">context: security/policy info for the request</span></em><br />
<em style="border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">volume: reference object of the volume being requested for reserve</span></em></div>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
Probably the most simple call in to Cinder. This method simply checks that the specified volume is in an “available” state and can be attached. Any other state results in an Error response notifying Nova that the volume is NOT available. The only valid state for this call to succeed is “available”.</div>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
If the volume is in fact available, we immediately issue an update to the Cinder database and mark the status of the volume to “attaching” thereby reserving the volume so that it won’t be used by another API call anywhere else.</div>
<h3 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 23px; font-style: inherit; font-weight: inherit; line-height: 1.2913em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">initialize_connection(self, context, volume, connector)</span></h3>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;">
<span style="border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">context: security/policy info for the request</em></span><br />
<span style="border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">volume: reference object of the volume being requested for reserve<br style="box-sizing: border-box;" />connector: information about the initiator if needed (ie targets that use access groups etc)</em></span></div>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px; vertical-align: baseline;">
This is the only Cinder API method that really has any significant work to do, and it’s the only one that really has any real interaction with the storage backend or driver. This method is responsible for building and returning all of the info needed by Nova to actually attach the specified volume. This method returns vital information to the caller (Nova) that includes things like CHAP credentials, iqn and lun information. An example response is shown here:<br />
<br /></div>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;">
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">{‘driver_volume_type': ‘iscsi’,</span><span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘data': {‘auth_password': ‘YZ2Hceyh7VySh5HY’,</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘target_discovered': False,</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘encrypted': False,</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘qos_specs': None,</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘target_iqn': ‘iqn.2010-10.org.openstack:volume-8b1ec3fe-8c5</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘target_portal': ‘11.0.0.8:3260′,</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘volume_id': ‘8b1ec3fe-8c57-45ca-a1cf-a481bfc8fce2′,</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘target_lun': 1,</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘access_mode': ‘rw’,</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘auth_username': ‘nE9PY8juynmmZ95F7Xb7′,</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> ‘auth_method': ‘CHAP’}}</span><br />
<span style="border: 0px; box-sizing: border-box; color: #666699; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></span></div>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;">
In the process of building this data structure, the Cinder manager makes a number of direct calls to the driver. The manager itself has a single initialize_connection call of it's own, but ties together a number of driver calls from within that method. <span style="font-family: inherit; font-style: inherit; font-weight: inherit;"> </span></div>
<h3 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="font-size: small;"><span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="color: #ff6600; line-height: 1.2913em;"> </span><span style="color: #ff6600; line-height: 1.2913em;">driver.validate_connector</span><br /><span style="color: #ff6600; line-height: 1.2913em;"> <span style="font-weight: normal;"> </span></span><span style="font-weight: normal;"><span style="line-height: 1.2913em;">Simply verifies that the initiator data is included in the passed in </span><span style="line-height: 24.1731357574463px;"><br /></span></span></span><span style="font-weight: normal;"><span style="font-family: inherit; font-style: inherit; line-height: 24.1731357574463px;"> </span><span style="font-family: inherit; font-style: inherit; line-height: 1.2913em;">connector (there are some drivers that utilize pieces of this connector<br /> data, but in the case of the reference, it just verifies it's there). </span></span></span></h3>
<div>
<h3 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: small;"><span style="color: #ff6600; line-height: 1.2913em;"> </span><span style="color: #ff6600; line-height: 1.2913em;">driver.create_export</span><br /><span style="color: #ff6600; line-height: 1.2913em;"> </span><span style="font-weight: normal; line-height: 1.2913em;">This is the target specific, persistent data associated with a volume.<br /> This method is responsible for building an actual iSCSI target, and<br /> providing the "location" and "auth" information which will be used to<br /> form the response data in the parent request.<br /> We call this infor the model_update and it's used to update vital target<br /> information associated with the volume in the Cinder database.</span></span></span></h3>
</div>
<div>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span><br />
<h3 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: small;"><span style="color: #ff6600; line-height: 1.2913em;"> </span><span style="color: #ff6600; line-height: 1.2913em;">driver.intialize_connection</span><br /><span style="color: #ff6600; line-height: 1.2913em;"> </span><span style="font-weight: normal; line-height: 1.2913em;">Now that we've actually built a target and persisted the important<br /> bits of information associated with it, we're ready to actually assign<br /> the target to a volume and form the needed info to pass back out<br /> to our caller. This is where we finally put everything together and<br /> form the example data structure response shown earlier.</span></span></span></span></h3>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</span>
<br />
<h3 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: small;"><span style="font-weight: normal; line-height: 1.2913em;"><br /> This method is sort of deceptive, it does a whole lot of formatting<br /> of the data we've put together in the create_export call, but it doesn't<br /> really offer any new info. It's completely dependent on the information<br /> that was gathered in the create_export call and put into the database. At<br /> this point, all we're doing is taking all the various entries from the database<br /> and putting it together into the desired format/structure.</span></span></span></span></h3>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</span>
<div>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: small;"><span style="line-height: 1.2913em;"> The key method call for updating and obtaining all of this info was<br /> done by the create_export call. This formatted data is then passed<br /> back up to the API and returned as the response back out to Nova.</span></span></span></span><br />
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: small;"><span style="line-height: 1.2913em;"><br /></span></span></span></span></div>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<div>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: small;"><span style="line-height: 1.2913em;">At this point Nova can use the returned info and actually make the iSCSI attach on the compute node, and then pass the volume into the requested Instance. If there are no errors, the volume is now actually attached to the Instance as a /dev/vdX device and ready for use. Remember however there was still one Cinder call left in our list: attach.</span></span></span></div>
<div>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: small;"><span style="line-height: 1.2913em;"><br /></span></span></span></div>
<div>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"></span><br />
<h3 style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; clear: both; color: #444444; font-family: inherit; font-size: 23px; font-style: inherit; font-weight: inherit; line-height: 1.2913em; margin: 30px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">attach(</span></span><span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: border-box; color: #ff6600; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">self, context, volume, </span></span><span style="color: #ff6600; font-style: inherit; font-weight: inherit;">instance_uuid, host_name,<br />mount_point, mode)</span></h3>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</span>
<br />
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;">
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">context: security/policy info for the request</em></span></span><br />
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">volume: reference object of the volume being requested for reserve<br style="box-sizing: border-box;" />instance_uuid: UUID of the Nova instance we've attached to<br />host_name: N/A for the reference driver<br />mount_point: device mount point on the instance (/dev/vdb)<br />mode: The attach mode of the Volume (rw, ro etc)</em></span></span></div>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</span>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;">
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">This is another method that falls into a category I call "update methods". It's purpose is to notify Cinder to update the status of the volume to "in-use" (attached) and to populate the database with the provided information regarding "where" it's attached to. </span></div>
<span style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;">
This also provides a mechanism to send notifications and updates back to the driver. </div>
<div style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; box-sizing: border-box; color: #444444; font-family: inherit; font-size: 18px; font-style: inherit; font-weight: inherit; line-height: 30px; margin-bottom: 30px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;">
<span style="border: 0px; box-sizing: border-box; color: grey; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><em style="border: 0px; box-sizing: border-box; font-family: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></em></span></div>
</span></div>
</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/03579029825538865886noreply@blogger.com0