Last active
May 11, 2016 08:33
-
-
Save marrabld/cf024faeac26859881fbc405ad04cb76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
<head> | |
<title>160511_notes</title> | |
<!-- 2016-05-11 Wed 16:31 --> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<meta name="generator" content="Org-mode" /> | |
<meta name="author" content="Daniel Marrable" /> | |
<style type="text/css"> | |
<!--/*--><![CDATA[/*><!--*/ | |
.title { text-align: center; } | |
.todo { font-family: monospace; color: red; } | |
.done { color: green; } | |
.tag { background-color: #eee; font-family: monospace; | |
padding: 2px; font-size: 80%; font-weight: normal; } | |
.timestamp { color: #bebebe; } | |
.timestamp-kwd { color: #5f9ea0; } | |
.right { margin-left: auto; margin-right: 0px; text-align: right; } | |
.left { margin-left: 0px; margin-right: auto; text-align: left; } | |
.center { margin-left: auto; margin-right: auto; text-align: center; } | |
.underline { text-decoration: underline; } | |
#postamble p, #preamble p { font-size: 90%; margin: .2em; } | |
p.verse { margin-left: 3%; } | |
pre { | |
border: 1px solid #ccc; | |
box-shadow: 3px 3px 3px #eee; | |
padding: 8pt; | |
font-family: monospace; | |
overflow: auto; | |
margin: 1.2em; | |
} | |
pre.src { | |
position: relative; | |
overflow: visible; | |
padding-top: 1.2em; | |
} | |
pre.src:before { | |
display: none; | |
position: absolute; | |
background-color: white; | |
top: -10px; | |
right: 10px; | |
padding: 3px; | |
border: 1px solid black; | |
} | |
pre.src:hover:before { display: inline;} | |
pre.src-sh:before { content: 'sh'; } | |
pre.src-bash:before { content: 'sh'; } | |
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; } | |
pre.src-R:before { content: 'R'; } | |
pre.src-perl:before { content: 'Perl'; } | |
pre.src-java:before { content: 'Java'; } | |
pre.src-sql:before { content: 'SQL'; } | |
table { border-collapse:collapse; } | |
caption.t-above { caption-side: top; } | |
caption.t-bottom { caption-side: bottom; } | |
td, th { vertical-align:top; } | |
th.right { text-align: center; } | |
th.left { text-align: center; } | |
th.center { text-align: center; } | |
td.right { text-align: right; } | |
td.left { text-align: left; } | |
td.center { text-align: center; } | |
dt { font-weight: bold; } | |
.footpara:nth-child(2) { display: inline; } | |
.footpara { display: block; } | |
.footdef { margin-bottom: 1em; } | |
.figure { padding: 1em; } | |
.figure p { text-align: center; } | |
.inlinetask { | |
padding: 10px; | |
border: 2px solid gray; | |
margin: 10px; | |
background: #ffffcc; | |
} | |
#org-div-home-and-up | |
{ text-align: right; font-size: 70%; white-space: nowrap; } | |
textarea { overflow-x: auto; } | |
.linenr { font-size: smaller } | |
.code-highlighted { background-color: #ffff00; } | |
.org-info-js_info-navigation { border-style: none; } | |
#org-info-js_console-label | |
{ font-size: 10px; font-weight: bold; white-space: nowrap; } | |
.org-info-js_search-highlight | |
{ background-color: #ffff00; color: #000000; font-weight: bold; } | |
/*]]>*/--> | |
</style> | |
<script type="text/javascript"> | |
/* | |
@licstart The following is the entire license notice for the | |
JavaScript code in this tag. | |
Copyright (C) 2012-2013 Free Software Foundation, Inc. | |
The JavaScript code in this tag is free software: you can | |
redistribute it and/or modify it under the terms of the GNU | |
General Public License (GNU GPL) as published by the Free Software | |
Foundation, either version 3 of the License, or (at your option) | |
any later version. The code is distributed WITHOUT ANY WARRANTY; | |
without even the implied warranty of MERCHANTABILITY or FITNESS | |
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. | |
As additional permission under GNU GPL version 3 section 7, you | |
may distribute non-source (e.g., minimized or compacted) forms of | |
that code without the copy of the GNU GPL normally required by | |
section 4, provided you include this license notice and a URL | |
through which recipients can access the Corresponding Source. | |
@licend The above is the entire license notice | |
for the JavaScript code in this tag. | |
*/ | |
<!--/*--><![CDATA[/*><!--*/ | |
function CodeHighlightOn(elem, id) | |
{ | |
var target = document.getElementById(id); | |
if(null != target) { | |
elem.cacheClassElem = elem.className; | |
elem.cacheClassTarget = target.className; | |
target.className = "code-highlighted"; | |
elem.className = "code-highlighted"; | |
} | |
} | |
function CodeHighlightOff(elem, id) | |
{ | |
var target = document.getElementById(id); | |
if(elem.cacheClassElem) | |
elem.className = elem.cacheClassElem; | |
if(elem.cacheClassTarget) | |
target.className = elem.cacheClassTarget; | |
} | |
/*]]>*///--> | |
</script> | |
</head> | |
<body> | |
<div id="content"> | |
<h1 class="title">160511_notes</h1> | |
<div id="table-of-contents"> | |
<h2>Table of Contents</h2> | |
<div id="text-table-of-contents"> | |
<ul> | |
<li><a href="#sec-1">1. Notes</a> | |
<ul> | |
<li><a href="#sec-1-1">1.1. Glossary of terms</a></li> | |
</ul> | |
</li> | |
<li><a href="#sec-2">2. Lab 2</a> | |
<ul> | |
<li><a href="#sec-2-1">2.1. Create a new user and tenant (project and tenant are the same thing)</a></li> | |
<li><a href="#sec-2-2">2.2. Use Glance to create an image</a></li> | |
<li><a href="#sec-2-3">2.3. Use Cinder to create Volume</a></li> | |
<li><a href="#sec-2-4">2.4. Use Heat to cleanup and delete projects and VMs</a></li> | |
</ul> | |
</li> | |
<li><a href="#sec-3">3. Lab 3</a> | |
<ul> | |
<li><a href="#sec-3-1">3.1. Use Heat template to create a stack</a></li> | |
<li><a href="#sec-3-2">3.2. VM placement</a></li> | |
<li><a href="#sec-3-3">3.3. Drop previous works</a></li> | |
<li><a href="#sec-3-4">3.4. register an SSH key with nova</a></li> | |
<li><a href="#sec-3-5">3.5. boot an instance and inject a file and ssh key</a></li> | |
<li><a href="#sec-3-6">3.6. Image customization</a></li> | |
<li><a href="#sec-3-7">3.7. Image migration</a></li> | |
</ul> | |
</li> | |
<li><a href="#sec-4">4. URLS</a></li> | |
<li><a href="#sec-5">5. Random notes</a></li> | |
</ul> | |
</div> | |
</div> | |
<div id="outline-container-sec-1" class="outline-2"> | |
<h2 id="sec-1"><span class="section-number-2">1</span> Notes</h2> | |
<div class="outline-text-2" id="text-1"> | |
</div><div id="outline-container-sec-1-1" class="outline-3"> | |
<h3 id="sec-1-1"><span class="section-number-3">1.1</span> Glossary of terms</h3> | |
</div> | |
</div> | |
<div id="outline-container-sec-2" class="outline-2"> | |
<h2 id="sec-2"><span class="section-number-2">2</span> Lab 2</h2> | |
<div class="outline-text-2" id="text-2"> | |
</div><div id="outline-container-sec-2-1" class="outline-3"> | |
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> Create a new user and tenant (project and tenant are the same thing)</h3> | |
<div class="outline-text-3" id="text-2-1"> | |
<ul class="org-ul"> | |
<li>use openstack for project | |
</li> | |
</ul> | |
<pre class="example"> | |
openstack project create <project name> | |
openstack user create --password pass user1 | |
openstack user list | grep user1 | |
openstack role add --project prj1 --user user1 _member_ | |
openstack user role list --project prj1 user1 | |
</pre> | |
<ul class="org-ul"> | |
<li>start cinder | |
</li> | |
</ul> | |
<pre class="example"> | |
cinder --os-username=user1 --os-password=pass --os-tenant-name=prj1 list | |
</pre> | |
</div> | |
</div> | |
<div id="outline-container-sec-2-2" class="outline-3"> | |
<h3 id="sec-2-2"><span class="section-number-3">2.2</span> Use Glance to create an image</h3> | |
<div class="outline-text-3" id="text-2-2"> | |
<ul class="org-ul"> | |
<li>do the next section as the Admin | |
</li> | |
</ul> | |
<pre class="example"> | |
glance image-create --name test --disk-format qcow2 --container-format bare --file /images/cirros.qcow2 | |
</pre> | |
<ul class="org-ul"> | |
<li>images are stored in /var/lib/glance/images | |
</li> | |
</ul> | |
<pre class="example"> | |
glance image-list | |
</pre> | |
<ul class="org-ul"> | |
<li>make the image public | |
</li> | |
</ul> | |
<pre class="example"> | |
glance image-update --is-public True <image ID> | |
glance image-show | |
</pre> | |
<ul class="org-ul"> | |
<li>add user1 as a member | |
</li> | |
</ul> | |
<pre class="example"> | |
glance member-create <imageID> <projectID> | |
</pre> | |
</div> | |
</div> | |
<div id="outline-container-sec-2-3" class="outline-3"> | |
<h3 id="sec-2-3"><span class="section-number-3">2.3</span> Use Cinder to create Volume</h3> | |
<div class="outline-text-3" id="text-2-3"> | |
<ul class="org-ul"> | |
<li>list volumes with | |
</li> | |
</ul> | |
<pre class="example"> | |
lvs cinder-volumes | |
</pre> | |
<ul class="org-ul"> | |
<li>Create a volume called vol1 with size of 1GB | |
</li> | |
</ul> | |
<pre class="example"> | |
cinder create --display-name vol1 1 | |
cinder list | |
</pre> | |
<ul class="org-ul"> | |
<li>use heat to create a VM and then attach the volume | |
</li> | |
</ul> | |
<pre class="example"> | |
heat stack-create -f /labfiles/lab1/test_instances.yaml lab1 | |
</pre> | |
<ul class="org-ul"> | |
<li>attache the volume to the VM | |
</li> | |
</ul> | |
<div class="org-src-container"> | |
<pre class="src src-sh">nova volume-attach <vmID><volumeID> | |
</pre> | |
</div> | |
<ul class="org-ul"> | |
<li>detach the volume, extend the volume and reattach | |
</li> | |
</ul> | |
<pre class="example"> | |
nova volume-detach <VMID> <volumeID> | |
cinder extend <volumeID> <size> | |
cinder list | |
nova volume-attach <vmID><volumeID> | |
</pre> | |
<ul class="org-ul"> | |
<li>Make a new file system on the mounted volume after ssh in to the instance | |
</li> | |
</ul> | |
<pre class="example"> | |
mkfs.ext3 /dev/vdb | |
mkdir /fs1 | |
mount /dev/vdb /fs1/ | |
</pre> | |
<ul class="org-ul"> | |
<li>Create a snapshot of the instance. First you have to freeze the file system | |
</li> | |
</ul> | |
<pre class="example"> | |
fsfreeze -f fs1 | |
exit | |
cinder snapshot-create --force=True --display-name vol1_snap <volumeID> | |
ssh <instance> | |
fsfreeze -u fs1 | |
cinder snapshot-list | |
</pre> | |
<ul class="org-ul"> | |
<li>to create a snapshot based on the previous snapshot | |
</li> | |
</ul> | |
<pre class="example"> | |
cinder create --snapshot-id a361693f-dc1e-4e71-8f07-c4a11e876268 --display-name vol1_backup 2 | |
cinder list | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
ID | |
</td> | |
<td align="left" valign="top"> | |
Status | |
</td> | |
<td align="left" valign="top"> | |
Display Name | |
</td> | |
<td align="left" valign="top"> | |
Size | |
</td> | |
<td align="left" valign="top"> | |
Volume Type | |
</td> | |
<td align="left" valign="top"> | |
Bootable | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
ab1038e6-8da3-476e-b928-621aea1a2358 <br /> | |
ddcee1c7-ccbb-433a-99a4-7fcbca96e006 | |
</td> | |
<td align="left" valign="top"> | |
available <br /> | |
available | |
</td> | |
<td align="left" valign="top"> | |
vol1_backup <br /> | |
vol1 | |
</td> | |
<td align="left" valign="top"> | |
2 <br /> | |
2 | |
</td> | |
<td align="left" valign="top"> | |
- <br /> | |
- | |
</td> | |
<td align="left" valign="top"> | |
false <br /> | |
false | |
</td> | |
</tr> | |
</table> | |
</div> | |
</div> | |
<div id="outline-container-sec-2-4" class="outline-3"> | |
<h3 id="sec-2-4"><span class="section-number-3">2.4</span> Use Heat to cleanup and delete projects and VMs</h3> | |
<div class="outline-text-3" id="text-2-4"> | |
<pre class="example"> | |
heat stack-delete lab1 | |
cinder delete <snapshotID> | |
</pre> | |
</div> | |
</div> | |
</div> | |
<div id="outline-container-sec-3" class="outline-2"> | |
<h2 id="sec-3"><span class="section-number-2">3</span> Lab 3</h2> | |
<div class="outline-text-2" id="text-3"> | |
</div><div id="outline-container-sec-3-1" class="outline-3"> | |
<h3 id="sec-3-1"><span class="section-number-3">3.1</span> Use Heat template to create a stack</h3> | |
<div class="outline-text-3" id="text-3-1"> | |
<pre class="example"> | |
heat stack-create -f /labfiles/lab3/net_setup.yaml lab3 | |
</pre> | |
</div> | |
</div> | |
<div id="outline-container-sec-3-2" class="outline-3"> | |
<h3 id="sec-3-2"><span class="section-number-3">3.2</span> VM placement</h3> | |
<div class="outline-text-3" id="text-3-2"> | |
<pre class="example"> | |
glance image-create --name cirros --disk-format qcow2 --container-format bare --file /image/cirros.qcow2 | |
</pre> | |
<ul class="org-ul"> | |
<li>create an availability zone1 | |
</li> | |
</ul> | |
<pre class="example"> | |
nova availability-zone-list | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
Name | |
</td> | |
<td align="left" valign="top"> | |
Status | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
internal <br /> | |
|- controller1.openstack.local <br /> | |
| |- nova-conductor <br /> | |
| |- nova-consoleauth <br /> | |
| |- nova-scheduler <br /> | |
| |- nova-cert <br /> | |
nova <br /> | |
|- compute1.openstack.local <br /> | |
| |- nova-compute <br /> | |
|- compute2.openstack.local <br /> | |
| |- nova-compute | |
</td> | |
<td align="left" valign="top"> | |
available <br /> | |
<br /> | |
enabled :-) 2016-05-11T06:13:37.000000 <br /> | |
enabled :-) 2016-05-11T06:13:35.000000 <br /> | |
enabled :-) 2016-05-11T06:13:29.000000 <br /> | |
enabled :-) 2016-05-11T06:13:35.000000 <br /> | |
available <br /> | |
<br /> | |
enabled :-) 2016-05-11T06:13:30.000000 <br /> | |
<br /> | |
enabled :-) 2016-05-11T06:13:30.000000 | |
</td> | |
</tr> | |
</table> | |
<pre class="example"> | |
nova aggregate-create aggr1 zone1 | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
Id | |
</td> | |
<td align="left" valign="top"> | |
Name | |
</td> | |
<td align="left" valign="top"> | |
Availability Zone | |
</td> | |
<td align="left" valign="top"> | |
Hosts | |
</td> | |
<td align="left" valign="top"> | |
Metadata | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
2 | |
</td> | |
<td align="left" valign="top"> | |
aggr1 | |
</td> | |
<td align="left" valign="top"> | |
zone1 | |
</td> | |
<td align="left" valign="top"> | |
| |
</td> | |
<td align="left" valign="top"> | |
'availability_zone=zone1' | |
</td> | |
</tr> | |
</table> | |
<pre class="example"> | |
nova aggregate-add-host aggr1 compute1.openstack.local | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
Id | |
</td> | |
<td align="left" valign="top"> | |
Name | |
</td> | |
<td align="left" valign="top"> | |
Availability Zone | |
</td> | |
<td align="left" valign="top"> | |
Hosts | |
</td> | |
<td align="left" valign="top"> | |
Metadata | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
2 | |
</td> | |
<td align="left" valign="top"> | |
aggr1 | |
</td> | |
<td align="left" valign="top"> | |
zone1 | |
</td> | |
<td align="left" valign="top"> | |
'compute1.openstack.local' | |
</td> | |
<td align="left" valign="top"> | |
'availability_zone=zone1' | |
</td> | |
</tr> | |
</table> | |
<pre class="example"> | |
nova availability-zone-list | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
Name | |
</td> | |
<td align="left" valign="top"> | |
Status | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
internal <br /> | |
|- controller1.openstack.local <br /> | |
| |- nova-conductor <br /> | |
| |- nova-consoleauth <br /> | |
| |- nova-scheduler <br /> | |
| |- nova-cert <br /> | |
zone1 <br /> | |
|- compute1.openstack.local <br /> | |
| |- nova-compute <br /> | |
nova <br /> | |
|- compute2.openstack.local <br /> | |
| |- nova-compute | |
</td> | |
<td align="left" valign="top"> | |
available <br /> | |
<br /> | |
enabled :-) 2016-05-11T06:16:27.000000 <br /> | |
enabled :-) 2016-05-11T06:16:25.000000 <br /> | |
enabled :-) 2016-05-11T06:16:29.000000 <br /> | |
enabled :-) 2016-05-11T06:16:25.000000 <br /> | |
available <br /> | |
<br /> | |
enabled :-) 2016-05-11T06:16:30.000000 <br /> | |
available <br /> | |
<br /> | |
enabled :-) 2016-05-11T06:16:30.000000 | |
</td> | |
</tr> | |
</table> | |
<ul class="org-ul"> | |
<li>Create a flavor | |
</li> | |
</ul> | |
<pre class="example"> | |
nova flavor-list | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
ID | |
</td> | |
<td align="left" valign="top"> | |
Name | |
</td> | |
<td align="left" valign="top"> | |
Memory_MB | |
</td> | |
<td align="left" valign="top"> | |
Disk | |
</td> | |
<td align="left" valign="top"> | |
Ephemeral | |
</td> | |
<td align="left" valign="top"> | |
Swap | |
</td> | |
<td align="left" valign="top"> | |
VCPUs | |
</td> | |
<td align="left" valign="top"> | |
RXTX_Factor | |
</td> | |
<td align="left" valign="top"> | |
Is_Public | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
1 <br /> | |
2 <br /> | |
21 <br /> | |
3 <br /> | |
4 <br /> | |
5 | |
</td> | |
<td align="left" valign="top"> | |
m1.tiny <br /> | |
m1.small <br /> | |
m1.normal <br /> | |
m1.medium <br /> | |
m1.large <br /> | |
m1.xlarge | |
</td> | |
<td align="left" valign="top"> | |
128 <br /> | |
512 <br /> | |
2048 <br /> | |
4096 <br /> | |
8192 <br /> | |
16384 | |
</td> | |
<td align="left" valign="top"> | |
1 <br /> | |
5 <br /> | |
20 <br /> | |
40 <br /> | |
80 <br /> | |
160 | |
</td> | |
<td align="left" valign="top"> | |
0 <br /> | |
0 <br /> | |
0 <br /> | |
0 <br /> | |
0 <br /> | |
0 | |
</td> | |
<td align="left" valign="top"> | |
<br /> | |
<br /> | |
<br /> | |
<br /> | |
<br /> | |
| |
</td> | |
<td align="left" valign="top"> | |
1 <br /> | |
1 <br /> | |
1 <br /> | |
2 <br /> | |
4 <br /> | |
8 | |
</td> | |
<td align="left" valign="top"> | |
1.0 <br /> | |
1.0 <br /> | |
1.0 <br /> | |
1.0 <br /> | |
1.0 <br /> | |
1.0 | |
</td> | |
<td align="left" valign="top"> | |
True <br /> | |
True <br /> | |
True <br /> | |
True <br /> | |
True <br /> | |
True | |
</td> | |
</tr> | |
</table> | |
<pre class="example"> | |
nova flavor-create n4s 66 256 1 1 | |
nova flavor-list | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
ID | |
</td> | |
<td align="left" valign="top"> | |
Name | |
</td> | |
<td align="left" valign="top"> | |
Memory_MB | |
</td> | |
<td align="left" valign="top"> | |
Disk | |
</td> | |
<td align="left" valign="top"> | |
Ephemeral | |
</td> | |
<td align="left" valign="top"> | |
Swap | |
</td> | |
<td align="left" valign="top"> | |
VCPUs | |
</td> | |
<td align="left" valign="top"> | |
RXTX_Factor | |
</td> | |
<td align="left" valign="top"> | |
Is_Public | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
1 <br /> | |
2 <br /> | |
21 <br /> | |
3 <br /> | |
4 <br /> | |
5 <br /> | |
66 | |
</td> | |
<td align="left" valign="top"> | |
m1.tiny <br /> | |
m1.small <br /> | |
m1.normal <br /> | |
m1.medium <br /> | |
m1.large <br /> | |
m1.xlarge <br /> | |
n4s | |
</td> | |
<td align="left" valign="top"> | |
128 <br /> | |
512 <br /> | |
2048 <br /> | |
4096 <br /> | |
8192 <br /> | |
16384 <br /> | |
256 | |
</td> | |
<td align="left" valign="top"> | |
1 <br /> | |
5 <br /> | |
20 <br /> | |
40 <br /> | |
80 <br /> | |
160 <br /> | |
1 | |
</td> | |
<td align="left" valign="top"> | |
0 <br /> | |
0 <br /> | |
0 <br /> | |
0 <br /> | |
0 <br /> | |
0 <br /> | |
0 | |
</td> | |
<td align="left" valign="top"> | |
<br /> | |
<br /> | |
<br /> | |
<br /> | |
<br /> | |
<br /> | |
| |
</td> | |
<td align="left" valign="top"> | |
1 <br /> | |
1 <br /> | |
1 <br /> | |
2 <br /> | |
4 <br /> | |
8 <br /> | |
1 | |
</td> | |
<td align="left" valign="top"> | |
1.0 <br /> | |
1.0 <br /> | |
1.0 <br /> | |
1.0 <br /> | |
1.0 <br /> | |
1.0 <br /> | |
1.0 | |
</td> | |
<td align="left" valign="top"> | |
True <br /> | |
True <br /> | |
True <br /> | |
True <br /> | |
True <br /> | |
True <br /> | |
True | |
</td> | |
</tr> | |
</table> | |
<ul class="org-ul"> | |
<li>Boot a flavor | |
</li> | |
</ul> | |
<pre class="example"> | |
nova boot --flavor 1 --image 9f7e9ca7-3608-4e9c-af96-71e955eb1e8d --nic net-id=${NET_ID} --availability-zone=zone1 vm1 | |
nova boot --flavor 66 --image cirros --nic net-id=${NET_ID} vm2 | |
</pre> | |
<pre class="example"> | |
nova list | |
</pre> | |
<ul class="org-ul"> | |
<li>Boot using the –hint keyword | |
</li> | |
</ul> | |
<pre class="example"> | |
nova boot --flavor 1 --image cirros --nic net-id=${NET_ID} --hint same_host=06c82b49-7ff2-41e9-bec1-6c5da1e4f4a4 vm3 | |
</pre> | |
<ul class="org-ul"> | |
<li>Check which hypervisor the VMs are running on | |
</li> | |
</ul> | |
<pre class="example"> | |
nova hypervisor-servers compute1.openstack.local | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
ID | |
</td> | |
<td align="left" valign="top"> | |
Name | |
</td> | |
<td align="left" valign="top"> | |
Hypervisor ID | |
</td> | |
<td align="left" valign="top"> | |
Hypervisor Hostname | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
06c82b49-7ff2-41e9-bec1-6c5da1e4f4a4 <br /> | |
275d58c4-4918-415c-b533-e4eaac5b91d8 | |
</td> | |
<td align="left" valign="top"> | |
instance-0000000b <br /> | |
instance-0000000d | |
</td> | |
<td align="left" valign="top"> | |
1 <br /> | |
1 | |
</td> | |
<td align="left" valign="top"> | |
compute1.openstack.local <br /> | |
compute1.openstack.local | |
</td> | |
</tr> | |
</table> | |
<pre class="example"> | |
nova hypervisor-servers compute2.openstack.local | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
ID | |
</td> | |
<td align="left" valign="top"> | |
Name | |
</td> | |
<td align="left" valign="top"> | |
Hypervisor ID | |
</td> | |
<td align="left" valign="top"> | |
Hypervisor Hostname | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
369ce73b-0c66-4c23-ae31-c8b508a81bb0 | |
</td> | |
<td align="left" valign="top"> | |
instance-0000000c | |
</td> | |
<td align="left" valign="top"> | |
2 | |
</td> | |
<td align="left" valign="top"> | |
compute2.openstack.local | |
</td> | |
</tr> | |
</table> | |
</div> | |
</div> | |
<div id="outline-container-sec-3-3" class="outline-3"> | |
<h3 id="sec-3-3"><span class="section-number-3">3.3</span> Drop previous works</h3> | |
<div class="outline-text-3" id="text-3-3"> | |
<pre class="example"> | |
nova delete $(nova list --minimal|awk '/vm[1234]/{print $2}') | |
</pre> | |
</div> | |
</div> | |
<div id="outline-container-sec-3-4" class="outline-3"> | |
<h3 id="sec-3-4"><span class="section-number-3">3.4</span> register an SSH key with nova</h3> | |
<div class="outline-text-3" id="text-3-4"> | |
<pre class="example"> | |
nova keypair-add --pub-key /tmp/vm_key.pub vm_key | |
nova keypair-list | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
Name | |
</td> | |
<td align="left" valign="top"> | |
Fingerprint | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
vm_key | |
</td> | |
<td align="left" valign="top"> | |
c6:42:ac:0d:92:44:fa:f0:c1:84:e3:4d:89:aa:82:e4 | |
</td> | |
</tr> | |
</table> | |
</div> | |
</div> | |
<div id="outline-container-sec-3-5" class="outline-3"> | |
<h3 id="sec-3-5"><span class="section-number-3">3.5</span> boot an instance and inject a file and ssh key</h3> | |
<div class="outline-text-3" id="text-3-5"> | |
<pre class="example"> | |
nova boot --flavor 1 --image cirros --nic net-id=${NET_ID} --file /tmp/1=/tmp/data --key-name=vm_key --user-data=/tmp/user_data --config-drive=true --meta key1=value1 vm1 | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
Property | |
</td> | |
<td align="left" valign="top"> | |
Value | |
</td> | |
</tr> | |
<tr> | |
<td align="left" valign="top"> | |
OS-DCF:diskConfig <br /> | |
OS-EXT-AZ:availability_zone <br /> | |
OS-EXT-SRV-ATTR:host <br /> | |
OS-EXT-SRV-ATTR:hypervisor_hostname <br /> | |
OS-EXT-SRV-ATTR:instance_name <br /> | |
OS-EXT-STS:power_state <br /> | |
OS-EXT-STS:task_state <br /> | |
OS-EXT-STS:vm_state <br /> | |
OS-SRV-USG:launched_at <br /> | |
OS-SRV-USG:terminated_at <br /> | |
accessIPv4 <br /> | |
accessIPv6 <br /> | |
adminPass <br /> | |
config_drive <br /> | |
created <br /> | |
flavor <br /> | |
hostId <br /> | |
id <br /> | |
image <br /> | |
key_name <br /> | |
metadata <br /> | |
name <br /> | |
os-extended-volumes:volumes_attached <br /> | |
progress <br /> | |
security_groups <br /> | |
status <br /> | |
tenant_id <br /> | |
updated <br /> | |
user_id | |
</td> | |
<td align="left" valign="top"> | |
MANUAL <br /> | |
nova <br /> | |
- <br /> | |
- <br /> | |
instance-0000000e <br /> | |
0 <br /> | |
scheduling <br /> | |
building <br /> | |
- <br /> | |
- <br /> | |
<br /> | |
<br /> | |
96jRw3uK2etT <br /> | |
True <br /> | |
2016-05-11T07:03:23Z <br /> | |
m1.tiny (1) <br /> | |
<br /> | |
8be878b1-dd8f-4139-8494-4b7e9e1ec1c8 <br /> | |
cirros (9f7e9ca7-3608-4e9c-af96-71e955eb1e8d) <br /> | |
vm_key <br /> | |
{"key1": "value1"} <br /> | |
vm1 <br /> | |
[] <br /> | |
0 <br /> | |
default <br /> | |
BUILD <br /> | |
eb77b585a9184304a0248537431c723f <br /> | |
2016-05-11T07:03:23Z <br /> | |
8f3c9ec8bbe641758ded53f333eb59f6 | |
</td> | |
</tr> | |
</table> | |
</div> | |
</div> | |
<div id="outline-container-sec-3-6" class="outline-3"> | |
<h3 id="sec-3-6"><span class="section-number-3">3.6</span> Image customization</h3> | |
<div class="outline-text-3" id="text-3-6"> | |
<pre class="example"> | |
glance image-download --progress --file /tmp/cirros.qcow2 cirros | |
virt-edit -a /tmp/cirros.qcow2 /etc/issue | |
</pre> | |
<ul class="org-ul"> | |
<li>upload the edited file | |
</li> | |
</ul> | |
<pre class="example"> | |
glance image-create --name cirros_hello --disk-format qcow2 --container-format bare --file /tmp/cirros.qcow2 --progress | |
</pre> | |
<ul class="org-ul"> | |
<li>Boot and test | |
</li> | |
</ul> | |
<pre class="example"> | |
nova boot --flavor 1 --image cirros_hello --nic net-id=${NET_ID} vm3 | |
nova console-log --length 10 vm3 | |
</pre> | |
</div> | |
</div> | |
<div id="outline-container-sec-3-7" class="outline-3"> | |
<h3 id="sec-3-7"><span class="section-number-3">3.7</span> Image migration</h3> | |
<div class="outline-text-3" id="text-3-7"> | |
<p> | |
Assign the floating ip address | |
</p> | |
<pre class="example"> | |
nova floating-ip-list | |
nova floating-ip-associate test_1 192.168.100.104 | |
nova list | |
</pre> | |
<!-- This HTML table template is generated by emacs 24.5.1 --> | |
<table border="1"> | |
<tr> | |
<td align="left" valign="top"> | |
a85ee500-1393-4ea4-8c36-5b5526950675 <br /> | |
47926d32-e8be-4be4-94ad-0f109bc8bbe6 | |
</td> | |
<td align="left" valign="top"> | |
test_1 <br /> | |
vm3 | |
</td> | |
<td align="left" valign="top"> | |
ACTIVE <br /> | |
ACTIVE | |
</td> | |
<td align="left" valign="top"> | |
- <br /> | |
- | |
</td> | |
<td align="left" valign="top"> | |
Running <br /> | |
Running | |
</td> | |
<td align="left" valign="top"> | |
int_gre1=10.30.30.106, 192.168.100.104 <br /> | |
int_gre1=10.30.30.105 | |
</td> | |
</tr> | |
</table> | |
<pre class="example"> | |
nova show test_1|grep hyper | |
nova migrate test_1 | |
nova list | |
nova resize-confirm test_1 | |
nova show test_1 | grep hyper | |
</pre> | |
</div> | |
</div> | |
</div> | |
<div id="outline-container-sec-4" class="outline-2"> | |
<h2 id="sec-4"><span class="section-number-2">4</span> URLS</h2> | |
<div class="outline-text-2" id="text-4"> | |
<ul class="org-ul"> | |
<li><a href="https://wiki.openstack.org/wiki/Manila">https://wiki.openstack.org/wiki/Manila</a> | |
</li> | |
</ul> | |
</div> | |
</div> | |
<div id="outline-container-sec-5" class="outline-2"> | |
<h2 id="sec-5"><span class="section-number-2">5</span> Random notes</h2> | |
<div class="outline-text-2" id="text-5"> | |
<ul class="org-ul"> | |
<li>Rabbit is the messaging system | |
</li> | |
<li>Glance is the image management service | |
</li> | |
<li>find out what vcpus are using | |
</li> | |
</ul> | |
<pre class="example"> | |
virsh vcpuinfo 2 | |
</pre> | |
<p> | |
line 80 | |
</p> | |
<p> | |
line 59 | |
</p> | |
</div> | |
</div> | |
</div> | |
<div id="postamble" class="status"> | |
<p class="author">Author: Daniel Marrable</p> | |
<p class="date">Created: 2016-05-11 Wed 16:31</p> | |
<p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 24.5.1 (<a href="http://orgmode.org">Org</a> mode 8.2.10)</p> | |
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment