美文网首页
无标题文章

无标题文章

作者: A诗人 | 来源:发表于2018-04-04 16:02 被阅读0次

如何在Openstack上运行ubuntu 镜像

作者:gandj

因为有个App要跑在ubuntu 14.04上面,故搭建虚拟机,摸索了一下,能正常登录后台,正常运行App了,也算是成功了。估计还有些错误,欢迎老鸟指正!

一:下载相关的镜像,要看清楚amd  arm,就这二个字母折腾。

下载的URL:http://cloud-images.ubuntu.com/trusty/20180330/?C=S;O=A,我下载的文件是14.04内核的:trusty-server-cloudimg-amd64-disk1.img ,并将此img文件上传到Op控制器的后台/root目录下。

二:到Op的控制器上转换格式,生成镜像

glance image-create --name "ubuntu_1404" --file trusty-server-cloudimg-amd64-disk1.img --disk-format qcow2 --container-format bare --is-public True --progress

等进度条跑完,就会有这个提示:

[=============================>] 100%

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

| Property         | Value                                |

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

| checksum         | c449695cd20f51f22bacd4d7f9227a3f     |

| container_format | bare                                 |

| created_at       | 2018-04-04T02:20:49                  |

| deleted          | False                                |

| deleted_at       | None                                 |

| disk_format      | qcow2                                |

| id               | 25d169c9-8dfc-4d4f-a178-26c257650d92 |

| is_public        | True                                 |

| min_disk         | 0                                    |

| min_ram          | 0                                    |

| name             | ubuntu_1404                          |

| owner            | 36d48a9e92dc4dd2bbe3be4e3e9ca531     |

| protected        | False                                |

| size             | 262734336                            |

| status           | active                               |

| updated_at       | 2018-04-04T02:21:13                  |

| virtual_size     | None                                 |

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

记住你命令中name后面的,它就是你在Web上能看到的镜像的标识。

注:如果报错,“You must provide a username via either --os-username or env[OS_USERNAME]”

就执行命令:

source admin-openrc.sh

admin-openrc.sh  文件内容是:

[root@controller0 ~]# more admin-openrc.sh

export OS_TENANT_NAME=admin

export OS_USERNAME=admin

export OS_PASSWORD=open***  (你自己的密码,不要照抄我)

export OS_AUTH_URL=http://controller0:35357/v2.0

三:建立云主机

注:如果报这样的错,建议用非admin登录来建,具体原因我不太清楚。

1)登录dashboard:

2)点击项目,实例,启动云主机,选择:从镜像启动,“镜像名称”选中:第二步name处的名字。

[if !supportLists]3)[endif]创建密钥对,因为这种方式下的Ubuntu不支持直接的用户名密码登录

点击+号,

找一台Linux主机,执行命令:ssh-keygen -t rsa -f cloud.key

二次回车,会生成二个文件:

4)将上图公钥的内容复制到下图“公钥”处:

然后“导入密钥对”。

5)将私钥文件cloudk.key内容Copy到你的电脑上,如下图:

6有人就喜欢用“控制台”,就喜欢用用户名密码登录,好吧,在“创建后”输入那5行。

7)点运行,主机创立完成。

再绑定浮动Ip即可正常用Key文件方式登录

四:SSh登录后台,Key选择第三步所保存在你电脑上的Key文件。

登录成功

相关文章

  • 无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章 无标题文章无标题文章无标题文章无...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • fasfsdfdf

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章

  • 无标题文章

    无标题文章 无标题文章 无标题文章无标题文章 无标题文章 无标题文章

网友评论

      本文标题:无标题文章

      本文链接:https://www.haomeiwen.com/subject/zyokhftx.html