openstack创建实例测试步骤
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创建实例测试步骤的更多相关文章
- openstack创建实例时aborted: Block Device Mapping is Invalid
问题产生原因: 直接先不创建新卷,点击否,待实例创建完毕后再分配卷.
- openstack创建虚拟机的步骤
图片来自互联网. 虚拟机启动过程如下: 1.界面或命令行通过RESTful API向keystone获取认证信息.2.keystone通过用户请求认证信息,并生成auth-token返回给对应的认证请 ...
- OpenStack创建实例错误解决方法
实例执行所请求操作失败,实例处于错误状态.: 请稍后再试 [错误: Build of instance beaeb5e0-26eb-4044-ae14-bb87d509886d aborted: Fa ...
- 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) ...
- openstack controller ha测试环境搭建记录(十五)——创建实例
# source demo-openrc.sh # ssh-keygenGenerating public/private rsa key pair.Enter file in which to sa ...
- OpenStack创建Win10实例
直接用Windows的iso文件创建实例是创建不出来的,需要先在kvm下创建qcow2格式的虚拟机,然后用已经创建好的虚拟机文件当做OpenStack的镜像来创建实例就好了. 首先第一点是需要有一台L ...
- 在OpenStack虚拟机实例中创建swap分区的一种方法
测试组里一个同学负责MapR的搭建,MapR文档中建议每个节点上至少有24GB的swap分区,不知道MapR为啥会有这种反人类的建议……swap无非就是一块顺序读写的磁盘空间,莫非省着内存不用,用sw ...
- iOS开发:创建真机调试证书步骤(还有一篇是真机测试步骤)(2015年)
(关于真机测试步骤的blog:http://blog.csdn.net/hbblzjy/article/details/51680282) 1.首先打开苹果的开发者网站(https://develop ...
- Openstack 使用Centos官方镜像创建实例记录
Openstack 使用Centos官方镜像创建实例记录 准备centos镜像 官方地址:http://cloud.centos.org/centos/7/images 可以看到有各种版本的镜像,我在 ...
随机推荐
- DLT(Diagnostic Log and Trace)嵌入式系统程序运行记录
http://blog.csdn.net/yanlinembed/article/details/49837975 DLT的使用有属于Application范畴与Context范畴.在使用DLT时,需 ...
- QML中的ExclusiveGroup
Exclusive这个单词在高中应该都学过,是互斥的意思.如果你没有上过或者还没有上到高中,那你非常棒,计算机领域的大师很多都是这么起步的. ExclusiveGroup顾名思义就是互斥分组,效果很明 ...
- 第一次安装ubuntu要设置的东西
1. 安装网卡驱动 lscpi 查看网卡型号 根据型号找到驱动源码 下载下来并编译 安装 2. 编译安卓源码的时候出现jdk型号不对的情况 把/usr/bin/java 删除,就可以了.
- AngularJS中如果ng-src 图片加载失败怎么办
我们知道AngularJS加载图片的方法是用技术分享加ng-src标签,例如: <img ng-src="{{currentUrl}}"/> 其中currentUrl为 ...
- 安装sysbench遇到找不到库文件的问题
export LD_LIBRARY_PATH=/usr/mysql/lib./configure --prefix=/usr/local/sysbench --with-mysql-includes= ...
- git简单常用的命令
git status --查看文件状态 git add+文件路径 --上传到缓存区 git add --all --全部传到缓存区 git commit -m '描述' --对上传文件做描述 git ...
- HDOJ3743<分治>
题意:求一个排列的逆序数. #include<cstdio> #include<iostream> #include<algorithm> const int ma ...
- [转]SSL协议详解
背景介绍 最近在看<密码学与网络安全>相关的书籍,这篇文章主要详细介绍一下著名的网络安全协议SSL. 在开始SSl介绍之前,先给大家介绍几个密码学的概念和相关的知识. 1.密 ...
- Git学习 -- 自定义Git
忽略特殊文件 在工作区创建.gitignore文件,编写内容 # Windows: Thumbs.db ehthumbs.db Desktop.ini # Python: 忽略Python编译产生的. ...
- HDU 3346 Lucky Number
水题 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> us ...