source admin-openrc.sh
keystone user-create --name=demo --pass=123456
keystone tenant-create --name=demo --description="Demo Tenant"
keystone user-role-add --user=demo --role=_member_ --tenant=demo

source demo-openrc.sh
ssh-keygen
nova keypair-add --pub-key ~/.ssh/id_rsa.pub demo-key
neutron net-create demo-net
(若指定VLAN,需管理员,且设置为共享,命令为:)
neutron net-create VLAN550 --router:external False --provider:network_type vlan --provider:physical_network physnet2 --provider:segmentation_id 550 --shared
neutron subnet-create demo-net --name demo-subnet --gateway 192.168.1.1 192.168.1.0/24
neutron router-create demo-router
neutron router-interface-add demo-router demo-subnet
neutron net-list
+--------------------------------------+-----------+-----------------------------------------------------+
| id                                   | name      | subnets                                             |
+--------------------------------------+-----------+-----------------------------------------------------+
| fd39c0bb-f3f5-45dc-8f61-0b516114731f | demo-net  | fb8687e8-1d64-4ed1-afc3-955454090682 192.168.1.0/24 |
| f3376efe-2024-4fa8-9cd5-0c10f2174655 | net04_ext | b39c4183-fe7e-4c71-b934-539a469691f2                |
+--------------------------------------+-----------+-----------------------------------------------------+
neutron router-gateway-set demo-router net04_ext
nova boot --flavor m1.tiny --image cirros-0.3.0-x86_64-disk --nic net-id=fd39c0bb-f3f5-45dc-8f61-0b516114731f --security-group default --key-name demo-key demo-instance1
nova list
+--------------------------------------+----------------+--------+------------+-------------+----------+
| ID                                   | Name           | Status | Task State | Power State | Networks |
+--------------------------------------+----------------+--------+------------+-------------+----------+
| 8423000d-56be-41ff-8a5b-bcf5c5472cf6 | demo-instance1 | BUILD  | spawning   | NOSTATE     |          |
+--------------------------------------+----------------+--------+------------+-------------+----------+

nova show 8423000d-56be-41ff-8a5b-bcf5c5472cf6
+--------------------------------------+-----------------------------------------------------------------+
| Property                             | Value                                                           |
+--------------------------------------+-----------------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                          |
| OS-EXT-AZ:availability_zone          | nova                                                            |
| OS-EXT-STS:power_state               | 1                                                               |
| OS-EXT-STS:task_state                | -                                                               |
| OS-EXT-STS:vm_state                  | active                                                          |
| OS-SRV-USG:launched_at               | 2015-12-30T09:57:16.000000                                      |
| OS-SRV-USG:terminated_at             | -                                                               |
| accessIPv4                           |                                                                 |
| accessIPv6                           |                                                                 |
| config_drive                         |                                                                 |
| created                              | 2015-12-30T09:56:01Z                                            |
| demo-net network                     | 192.168.1.2                                                     |
| flavor                               | m1.tiny (1)                                                     |
| hostId                               | 8bfc62fe3673abca838ee2a0f1eab68b771c1469709a7408c4ff98dd        |
| id                                   | 8423000d-56be-41ff-8a5b-bcf5c5472cf6                            |
| image                                | cirros-0.3.0-x86_64-disk (bafeb4c4-781a-49f7-8c9d-9b9db7604db1) |
| key_name                             | demo-key                                                        |
| metadata                             | {}                                                              |
| name                                 | demo-instance1                                                  |
| os-extended-volumes:volumes_attached | []                                                              |
| progress                             | 0                                                               |
| security_groups                      | default                                                         |
| status                               | ACTIVE                                                          |
| tenant_id                            | e234241403d744dfba9ce21f6371fc0e                                |
| updated                              | 2015-12-30T09:57:17Z                                            |
| user_id                              | db35fe5dcc3049dd9c297a6d37ff5b0d                                |
+--------------------------------------+-----------------------------------------------------------------+

nova get-vnc-console demo-instance1 novnc
+-------+----------------------------------------------------------------------------------+
| Type  | Url                                                                              |
+-------+----------------------------------------------------------------------------------+
| novnc | http://168.1.22.30:6080/vnc_auto.html?token=ba5ee3f7-56d2-4113-8b66-b356201dbef6 |
+-------+----------------------------------------------------------------------------------+

ping 192.168.1.1

ping 218.85.157.99

测试分配浮动IP:

nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
+-------------+-----------+---------+-----------+--------------+
| IP Protocol | From Port | To Port | IP Range  | Source Group |
+-------------+-----------+---------+-----------+--------------+
| icmp        | -1        | -1      | 0.0.0.0/0 |              |
+-------------+-----------+---------+-----------+--------------+

nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
+-------------+-----------+---------+-----------+--------------+
| IP Protocol | From Port | To Port | IP Range  | Source Group |
+-------------+-----------+---------+-----------+--------------+
| tcp         | 22        | 22      | 0.0.0.0/0 |              |
+-------------+-----------+---------+-----------+--------------+

neutron floatingip-create net04_ext
Created a new floatingip:
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| fixed_ip_address    |                                      |
| floating_ip_address | 168.1.22.42                          |
| floating_network_id | f3376efe-2024-4fa8-9cd5-0c10f2174655 |
| id                  | 8a11d12c-50be-4f61-9721-b9aacf92f496 |
| port_id             |                                      |
| router_id           |                                      |
| status              | DOWN                                 |
| tenant_id           | e234241403d744dfba9ce21f6371fc0e     |
+---------------------+--------------------------------------+

nova floating-ip-associate demo-instance1 168.1.22.42
nova list
+--------------------------------------+----------------+--------+------------+-------------+-----------------------------------+
| ID                                   | Name           | Status | Task State | Power State | Networks                          |
+--------------------------------------+----------------+--------+------------+-------------+-----------------------------------+
| 8423000d-56be-41ff-8a5b-bcf5c5472cf6 | demo-instance1 | ACTIVE | -          | Running     | demo-net=192.168.1.2, 168.1.22.42 |
+--------------------------------------+----------------+--------+------------+-------------+-----------------------------------+

C:\>ping 168.1.22.42

正在 Ping 168.1.22.42 具有 32 字节的数据:
来自 168.1.22.42 的回复: 字节=32 时间=3ms TTL=62
来自 168.1.22.42 的回复: 字节=32 时间=1ms TTL=62

ssh 168.1.22.42

创建卷并分配卷:
cinder create --display-name demo-volume1 1
nova volume-list
+--------------------------------------+-----------+--------------+------+-------------+-------------+
| ID                                   | Status    | Display Name | Size | Volume Type | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+-------------+
| ae0fe7e4-8db6-4b95-b2ae-f98c7ebca920 | available | demo-volume1 | 1    | None        |             |
+--------------------------------------+-----------+--------------+------+-------------+-------------+
nova volume-attach demo-instance1 ae0fe7e4-8db6-4b95-b2ae-f98c7ebca920

ssh 168.1.22.42
login as: root
root@168.1.22.42's password:
# fdisk -l

Disk /dev/vda: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *       16065     2088449     1036192+  83  Linux

Disk /dev/vdb: 1073 MB, 1073741824 bytes
16 heads, 63 sectors/track, 2080 cylinders, total 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/vdb doesn't contain a valid partition table

nova volume-detach demo-instance1 ae0fe7e4-8db6-4b95-b2ae-f98c7ebca920

# fdisk -l

Disk /dev/vda: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *       16065     2088449     1036192+  83  Linux

openstack创建实例测试步骤的更多相关文章

  1. openstack创建实例时aborted: Block Device Mapping is Invalid

    问题产生原因: 直接先不创建新卷,点击否,待实例创建完毕后再分配卷.

  2. openstack创建虚拟机的步骤

    图片来自互联网. 虚拟机启动过程如下: 1.界面或命令行通过RESTful API向keystone获取认证信息.2.keystone通过用户请求认证信息,并生成auth-token返回给对应的认证请 ...

  3. OpenStack创建实例错误解决方法

    实例执行所请求操作失败,实例处于错误状态.: 请稍后再试 [错误: Build of instance beaeb5e0-26eb-4044-ae14-bb87d509886d aborted: Fa ...

  4. openstack 创建实例报错 **aborted: Failed to allocate the network(s), not rescheduling

    消息 Build of instance 6320b5f2-edc2-4e8e-b07c-0047f7ed8f6a aborted: Failed to allocate the network(s) ...

  5. openstack controller ha测试环境搭建记录(十五)——创建实例

    # source demo-openrc.sh # ssh-keygenGenerating public/private rsa key pair.Enter file in which to sa ...

  6. OpenStack创建Win10实例

    直接用Windows的iso文件创建实例是创建不出来的,需要先在kvm下创建qcow2格式的虚拟机,然后用已经创建好的虚拟机文件当做OpenStack的镜像来创建实例就好了. 首先第一点是需要有一台L ...

  7. 在OpenStack虚拟机实例中创建swap分区的一种方法

    测试组里一个同学负责MapR的搭建,MapR文档中建议每个节点上至少有24GB的swap分区,不知道MapR为啥会有这种反人类的建议……swap无非就是一块顺序读写的磁盘空间,莫非省着内存不用,用sw ...

  8. iOS开发:创建真机调试证书步骤(还有一篇是真机测试步骤)(2015年)

    (关于真机测试步骤的blog:http://blog.csdn.net/hbblzjy/article/details/51680282) 1.首先打开苹果的开发者网站(https://develop ...

  9. Openstack 使用Centos官方镜像创建实例记录

    Openstack 使用Centos官方镜像创建实例记录 准备centos镜像 官方地址:http://cloud.centos.org/centos/7/images 可以看到有各种版本的镜像,我在 ...

随机推荐

  1. velocity 语法

    1,如果调用是第一条就加上类名current. #foreach($info in $aboutlist) <li><a href="$!{info.href}" ...

  2. px和sp什么区别

    都表示像素,只不过sp通常表示文字大小: <TextView android:layout_width="wrap_content" android:layout_heigh ...

  3. 前端 MVC 变形记

    背景: MVC是一种架构设计模式,它通过关注点分离鼓励改进应用程序组织.在过去,MVC被大量用于构建桌面和服务器端应用程序,如今Web应用程序的开 发已经越来越向传统应用软件开发靠拢,Web和应用之间 ...

  4. Eclipse下配置和使用Hibernate Tools

    本文转自:http://radiumwong.iteye.com/blog/358585 Hibernate Tools可以通过访问已经建立好的数据库以反向工程方式生成POJO文件. 今天就来说一下如 ...

  5. c printf()详解[转载]

    ref : http://www.cnblogs.com/yuaqua/archive/2011/10/21/2219856.html #include <cstdio> #include ...

  6. asp:cookies的属性

    Expires – 过期时间.指定cookie的生命期.具体是值是过期日期.如果想让cookie的存在期限超过当前浏览器会话时间,就必须使用这个属性.当过了到期日期时,浏览器就可以删除cookie文件 ...

  7. rollout

    #! /bin/ksh #  设置环境变量 ############### ###   UAT   ### ############### export ENVS=/test/change/env/e ...

  8. php sso 单点登录的实现 代码示例

    先说一下这样做的好处吧,先来三个屌丝域名: www.openpoor.com myspace.openpoor.com passport.openpoor.com 大家都知道,虽然他们都是一个域名但主 ...

  9. 项目中的BaseServlet

    BaseServlet代码: import java.io.IOException; import java.lang.reflect.Method; import javax.servlet.Ser ...

  10. [原]点击按钮,表格隔行变色:偶数行为黄色背景,奇数行为默认颜色。通过table的getElementsByTagName取得所有的tr,依次遍历,如果是偶数就…………。

    window.onload = function () { document.getElementById('btn').onclick = function () {                 ...