CentOS 7部署OpenStack(8)—创建第一台虚拟机

创建key

[[email protected] ~]# source kevin-openrc.sh

[[email protected] ~]# ssh-keygen -q -N ""

[[email protected] ~]# nova keypair-add --pub-key .ssh/id_rsa.pub mykey

[[email protected] ~]# nova keypair-list

+-------+-------------------------------------------------+

| Name  | Fingerprint                                     |

+-------+-------------------------------------------------+

| mykey | e8:8e:1f:33:d2:75:b6:32:bd:7d:68:aa:a1:f6:d5:fe |

+-------+-------------------------------------------------+

创建安全组

[[email protected] ~]# 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 |              |

+-------------+-----------+---------+-----------+--------------+

设置安全组规则

[[email protected] ~]# 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 |              |

+-------------+-----------+---------+-----------+--------------+

创建虚拟机

查看虚拟机类型

[email protected] ~]# nova flavor-list

+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+

| ID | Name      | Memory_MB | Disk| Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |

+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+

| 1  | m1.tiny   | 512      | 1    | 0         |     | 1     | 1.0         | True      |

| 2  | m1.small  | 2048     | 20   | 0         |     | 1     | 1.0         | True      |

| 3  | m1.medium | 4096      | 40  | 0         |      | 2    | 1.0         | True      |

| 4  | m1.large  | 8192     | 80   | 0         |     | 4     | 1.0         | True      |

| 5  | m1.xlarge | 16384     | 160 | 0         |      | 8    | 1.0         | True      |

+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+

查看网络类型

[[email protected] ~]# neutron net-list

+--------------------------------------+------+-----------------------------------------------------+

| id                                  | name | subnets                                             |

+--------------------------------------+------+-----------------------------------------------------+

| d9aa89ae-01ba-4a3d-b553-7e63d48d0acb | flat |a645f499-90a2-4e90-8bcb-f9040392c6bb 192.168.1.0/24 |

+--------------------------------------+------+-----------------------------------------------------+

查看镜像

[[email protected] ~]# nova image-list

+--------------------------------------+--------+--------+--------+

| ID                                  | Name   | Status | Server |

+--------------------------------------+--------+--------+--------+

| de72b13d-3f0f-4292-9afa-30c94175c3b5 | cirros | ACTIVE |        |

+--------------------------------------+--------+--------+--------+

查看安全组

[[email protected] ~]# nova secgroup-list

+--------------------------------------+---------+------------------------+

| Id                                  | Name    | Description            |

+--------------------------------------+---------+------------------------+

| d73f3911-7d65-4833-8e6c-bddfd39b2592 | default | Default security group|

+--------------------------------------+---------+------------------------+

开始创建虚拟机

[[email protected] ~]# nova boot --flavor m1.tiny --image cirros --nicnet-id=d9aa89ae-01ba-4a3d-b553-7e63d48d0acb --security-group default --key-name mykey first-instance

+--------------------------------------+-----------------------------------------------+

| Property                             | Value                                         |

+--------------------------------------+-----------------------------------------------+

| OS-DCF:diskConfig                   | MANUAL                                        |

| OS-EXT-AZ:availability_zone         |                                              |

| OS-EXT-STS:power_state              | 0                                             |

| OS-EXT-STS:task_state               | scheduling                                    |

| OS-EXT-STS:vm_state                 | building                                      |

| OS-SRV-USG:launched_at              | -                                             |

| OS-SRV-USG:terminated_at            | -                                            |

| accessIPv4                          |                                              |

| accessIPv6                          |                                              |

| adminPass                           | b2C3o9MR6cS8                                  |

| config_drive                        |                                              |

| created                             | 2015-12-29T10:16:06Z                          |

| flavor                              | m1.tiny (1)                                   |

| hostId                              |                                              |

| id                                  | 8beb0b38-9ca4-4384-bee2-91988d0a9ab2          |

| image                               | cirros (de72b13d-3f0f-4292-9afa-30c94175c3b5) |

| key_name                            | mykey                                         |

| metadata                            | {}                                            |

| name                                 | first-instance                                |

| os-extended-volumes:volumes_attached | []                                            |

| progress                            | 0                                             |

| security_groups                      | default                                       |

| status                              | BUILD                                         |

| tenant_id                           | 1ee793c741f64d25be9010d59e4b5a3d              |

| updated                              |2015-12-29T10:16:06Z                         |

| user_id                             | c5baee07132c40f9841a607af1789ed6              |

+--------------------------------------+-----------------------------------------------+

此时虚拟机就开始创建了,可以使用nova list查看

[[email protected] ~]# nova list

+--------------------------------------+----------------+--------+------------+-------------+--------------------+

| ID                                  | Name           | Status | TaskState | Power State | Networks          |

+--------------------------------------+----------------+--------+------------+-------------+--------------------+

| 8beb0b38-9ca4-4384-bee2-91988d0a9ab2 | first-instance | ACTIVE | -          | Running     | flat=192.168.1.101 |

+--------------------------------------+----------------+--------+------------+-------------+--------------------+

出现running表示创建成功,可以ping同,也可以ssh连接

[[email protected] ~]# ssh [email protected]

获取web连接页面

[[email protected] ~]# nova get-vnc-console first-instance novnc

+-------+-----------------------------------------------------------------------------------+

| Type  | Url                                                                              |

+-------+-----------------------------------------------------------------------------------+

| novnc |http://192.168.1.11:6080/vnc_auto.html?token=299e9487-02ba-4f4f-b84a-791ba4aee7a6|

+-------+-----------------------------------------------------------------------------------+

在浏览器中输入给出的web地址就可以连接到该虚拟机

Linux运维开发群:298324302

北京linux运维求职招聘群:153677549

时间: 2024-12-30 03:06:14

CentOS 7部署OpenStack(8)—创建第一台虚拟机的相关文章

创建第一台虚拟机在Azure Stack TP2

前面一片博文我们已经成功的部署了Azure Stack TP2的POC环境,那么今天我们就来看一下如何在Azure Stack上创建我们的第一台虚拟机. Azure Stack TP2部署成功以后,我们需要打开虚拟机MAS-CON1的控制台(可以使用RDP的方式连接),登陆虚拟机MAS-CON1以后我们会发现在桌面上有一个快捷方式"Microsoft Azure Stack POC Portal",双击快捷方式启动新门户. 使用部署Azure Stack的时候使用的Azure账号登陆:

在openstack上创建第一个虚拟机

一.创建虚拟网络 第一次创建虚拟机,使用命令行来创建 在控制节点上,加载 admin 凭证来获取管理员能执行的命令访问权限 [[email protected] ~]# source admin-openstack.sh 创建提供者网络 [[email protected] ~]# neutron net-create --shared --provider:physical_network public --provider:network_type flat public-net Creat

CentOS 7部署OpenStack(7)—部署Newtron(计算节点)

首先非常抱歉,最近一直比较忙没有更新. 安装neutron [[email protected] ~]# yum install -y openstack-neutronopenstack-neutron-linuxbridge ebtables ipset 配置neutron 控制节点和计算节点的配置一样,可以直接从控制节点拷贝. [[email protected] ~]# scp /etc/neutron/neutron.conf 192.168.1.12:/etc/neutron/ [[

convirt(二)—— 创建第一台虚机

1.拷贝cms公钥到managed上,cms依赖免秘钥的root执行环境 #非默认端口,你懂的 ssh-copy-id -i ~/.ssh/id_rsa.pub "-p port_number [email protected]" 2.managed上存放iso目录,拷贝镜像存放到该目录 #目录位置和名称随意,只是模板里指定的时候需要指定好即可 mkdir /opt/iso # ls /opt/iso/ CentOS-6.4-x86_64-bin-DVD1.iso 3.增加manage

linux学习笔记1:使用VM创建一台虚拟机

在linux的学习中,需要搭建linux系统环境,而使用VM是一个很好的选择, VM全称vmware worksta使用tion方面,仿真度高,那下面介绍如何使用VM创建一台虚拟机. 1.打开软件 2.选择新建一台虚拟机后出现如下界面,选择自定义安装: 3.选择硬件兼容性: 4.安装时,选择的是稍后再安装操作系统,意思是先创建一台空白的,没有任何操作系统的虚拟机,后期再根据自己的需求安装操作系统. 5.这一步的安装中,需要选择操作系统,因为后期是想要在这台机器上装linux的,所以选择了linu

XenMobile 9.0完全部署指南之安装第一台DeviceManager--04

经过前期的证书与数据库准备,接下来我们可以开始XenMobile的正式安装了,XenMobile2个组件,我们首先介绍DeviceManager的安装,该组件主要用于移动设备管理.为了避免单点故障,DeviceManager采用集群方式部署.其集群机制采用自身的高可用技术进行同步,前段用户访问的负载均衡采用NetScaler实现 XM Device Manager系统需求 XenMobile DeviceManager当前安装支持的操作系统: Windows Server 2012 Datace

使用Vmware克隆功能快速创建多台虚拟机

关于克隆 克隆是将某一时刻的虚拟机状态复制为另一台虚拟机,在完成克隆操作后,你会得到两台一模一样的虚拟机. 你可以理解为:Vmware根据源虚拟机的硬件配置了新的一台虚拟机,并把原虚拟机的所有硬盘数据复制到新的虚拟机硬盘上. 众所周知,国内是明确反对进行克隆人研究的,所以我们以金鱼举例克隆的作用: 假设有一条金鱼,你想把它培育成一群会唱.跳.rap.篮球金鱼,那么你有以下两种选择: 买很多条这样的金鱼,然后分别对这些金鱼进行上述技能的培训.这样的缺点是很明显的:你要对每条金鱼进行完全一样的培训,

CentOS 7部署OpenStack(1)-—准备基础环境

本文主要安装最新版L版openstack,采用yum安装方式,编译安装后面后跟上. 操作指导: 只有"#"的命令行表示在所有的节点均进行操作:命令行有主机名的表示仅在该主机上进行操作. 另外,官方文档时间同步采用的是chrony,本文仍采用ntp服务. 1.系统环境 # uname -r 3.10.0-229.el7.x86_64 # cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) 2.服务器部署 IP 主机名

CentOS 7部署OpenStack(6)—部署Newtron(控制节点)

同步数据库 [[email protected] ~]# mysql -u root -p -e "CREATE DATABASEneutron;" Enter password: [[email protected] ~]# mysql -u root -p -e "GRANT ALL PRIVILEGES ONneutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';" Enter password: