• 第十六章 操作系统镜像的创建和登入


    1、下载官网云镜像到本地服务器

    目前很多的操作系统发行版都制作了OpenStack使用的镜像文件,大部分镜像禁止账号密码认证登陆,这些镜像在启动的时候可以注入密钥对(cloud-init),所以你需要使用你的私钥进行登陆。
    1、CentOS 6
    http://cloud.centos.org/centos/6/images/
    2、CentOS 7
    http://cloud.centos.org/centos/7/images/
    CentOS云镜像的默认登陆账户为centos
    3、CirrOS (test)
    http://download.cirros-cloud.net/
    4、Debian
    http://cdimage.debian.org/cdimage/openstack/
    Debian云镜像的默认登陆账户为debian
    5、Fedora
    https://alt.fedoraproject.org/cloud/
    Fedora云镜像的默认登陆账户为fedora
    6、Microsoft Windows
    https://cloudbase.it/windows-cloud-images/
    7、Ubuntu
    http://cloud-images.ubuntu.com/
    Ubuntu云镜像的默认登陆账户为ubuntu
    8、openSUSE
    http://download.opensuse.org/repositories/Cloud:/Images:/
    9、Red Hat Enterprise Linux 6
    https://access.redhat.com/downloads/content/69/ver=/rhel---6/x86_64/product-downloads
    10、Red Hat Enterprise Linux 7
    https://access.redhat.com/downloads/content/69/ver=/rhel---7/x86_64/product-downloads
    RHEL云镜像的默认登陆账户为cloud-user
    
    # 针对img文件创建镜像操作,镜像文件保存在/var/kvm/images/ubuntu-18.04-server-cloudimg-amd64.img下
    openstack image create "Ubuntu1804" --file /var/kvm/images/ubuntu-18.04-server-cloudimg-amd64.img --disk-format qcow2 --container-format bare --public

    2、针对ISO镜像文件

    # 针对ISO文件创建镜像操作
    glance image-create  --file ubuntu-16.04.1-server-amd64.iso  --disk-format iso  --container-format bare  --public  --name ubuntu-16.04.1-server-amd64
    # 从Dashboard选择Boot from image(creates a new volume,指定上传的ISO镜像即可,进行正常的安装系统操作

    3、(可选)默认登入镜像系统需要到key才能登入(在通过web页面启动实例的时候会有选择,下载即可),如果不想这样,可以在web操作openstack启动实例时通过添加启动脚本方式来修改用户密码,然后就可以在客户端通过ssh远程登入了,加入修改脚本如下:(推荐xshell软件)

    # 以下脚本针对的事Ubuntu18系统,各个镜像用户名请在下载镜像时的官网确认
    #!/bin/sh
    passwd ubuntu<<EOF
    ubuntu
    ubuntu
    EOF
    sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
    service ssh restart
  • 相关阅读:
    承载进程 (vshost.exe)
    命令行生成解决方案
    【SQL Server】存储过程的设计概念(3)TSQL的编译和执行过程
    .NET Framework 4
    reflector最新说明
    应用程序域
    vi 编辑器的用法(2013最新整理)
    linux中查看日志的方法
    修改linux主机名的方法介绍
    如何获得桌面上任意一个位置的颜色的 rgb 或者16进制值了
  • 原文地址:https://www.cnblogs.com/shihongkuan/p/11401306.html
Copyright © 2020-2023  润新知