openstack上传镜像


下载镜像:

http://cloud.centos.org/centos/6/images/

http://cloud.centos.org/centos/7/images/

1、执行环境变量

[root@qas-controller ~]# source admin-openrc.sh 

2、查看openstack所以有的镜像

[root@qas-controller ~]# glance image-list +--------------------------------------+--------+ | ID                                   | Name   | +--------------------------------------+--------+ | c2161609-843d-4878-ae37-cc9711126ce7 | cirros |

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

3、上传镜像

[root@qas-controller ~]# glance image-create --name "centos7.1" --file CentOS-7-x86_64-GenericCloud-1503.qcow2 --disk-format qcow2 --container-format bare  --visibility public --progress [=============================>] 100% +------------------+--------------------------------------+ | Property         | Value                                | +------------------+--------------------------------------+ | checksum         | 9eca98f4b3ad7e6dd4390a9d181381c9     | | container_format | bare                                 | | created_at       | 2016-11-17T11:56:23Z                 | | disk_format      | qcow2                                | | id               | 8c4f2a82-39b1-4f65-a59d-f0eecff96655 | | min_disk         | 0                                    | | min_ram          | 0                                    | | name             | centos7.1                            | | owner            | 20b587bcfe564197bcdf48e25579fe4a     | | protected        | False                                | | size             | 1004994560                           | | status           | active                               | | tags             | []                                   | | updated_at       | 2016-11-17T11:56:38Z                 | | virtual_size     | None                                 | | visibility       | public                               | +------------------+--------------------------------------


4、查看上传结果

openstack上传镜像_第1张图片


5、修改centos官方提供openstack镜像,默认用户是centos

[root@qas-controller ~]# source demo-openrc.sh  [root@qas-controller ~]# nova list +--------------------------------------+------------+--------+------------+-------------+-----------------------+ | ID                                   | Name       | Status | Task State | Power State | Networks              | +--------------------------------------+------------+--------+------------+-------------+-----------------------+ | c0af81d1-e126-4e65-8c83-689059ddef67 | ELK-node-1 | ACTIVE | -          | Running     | provider=172.16.8.217 | | a0147211-d715-46a8-8678-1ff9e925f8fc | ELK-node-2 | ACTIVE | -          | Running     | provider=172.16.8.218 | +--------------------------------------+------------+--------+------------+-------------+-----------------------+

[root@qas-controller ~]# ssh [email protected] Last login: Thu Nov 17 13:24:09 2016 from 172.16.8.51

[centos@elk-node-1 ~]$ sudo su -

上一次登录:四 11月 17 13:26:01 UTC 2016pts/0 上

[root@elk-node-1 ~]# passwd centos Changing password for user centos. New password:  Retype new password:  passwd: all authentication tokens updated successfully.

openstack上传镜像_第2张图片


你可能感兴趣的:(云计算)