博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[OpenStack] OpenStack Essex - Glance - Image Management
阅读量:6873 次
发布时间:2019-06-26

本文共 4798 字,大约阅读时间需要 15 分钟。

 

 

Introduction

There are several pre-built images for OpenStack available from various sources. You can download such images and use them to get familiar with OpenStack.

For any production deployment, you may like to have the ability to bundle custom images, with a custom set of applications or configuration. This chapter will guide you through the process of creating Linux images of popular distributions from scratch. We have also covered an approach to bundling Windows images.

There are some minor differences in the way you would bundle a Linux image, based on the distribution. Ubuntu makes it very easy by providing cloud-init package, which can be used to take care of the instance configuration at the time of launch. cloud-init handles importing ssh keys for password-less login, setting host name etc. The instance acquires the instance specific configuration from Nova-compute by connecting to a meta data interface running on 169.254.169.254.

While creating the image of a distro that does not have cloud-init or an equivalent package, you may need to take care of importing the keys etc. by running a set of commands at boot time from rc.local.

The process used for creating the Linux images of different distributions is largely the same with a few minor differences, which is explained below.

In all the cases, the documentation below assumes that you have a working KVM installation to use for creating the images. We are using the machine called 'client1' as explained in the chapter on "Installation and Configuration" for this purpose.

The approach explained below will generate disk images that represent a disk without any partitions.

 

Creating a Linux Image

The first step would be to create an image on Client1. This will represent the main HDD of the virtual machine, so make sure to give it as much space as you will need.

kvm-img create -f qcow2 server.img 5G

OS Installation

Download the iso file of the Linux distribution you want to install in the image. For Ubuntu, you can download the iso from using 'wget' or with the help of a browser

Boot a KVM instance with the OS installer ISO in the virtual CD-ROM. This will start the installation process. The command below also sets up a VNC display at port 0

sudo kvm -m 256 -cdrom ubuntu-12.04-server-amd64.iso -drive file=server.img,if=virtio,index=0 -boot d -net nic -net user -nographic  -vnc :0

Connect to the VM through VNC (use display number :0) and finish the installation.

For Example, where 10.10.10.4 is the IP address of client1:

vncviewer 10.10.10.4 :0

During creation of Linux images , create a single ext4 partition mounted on a swap partition.

After finishing the installation, relaunch the VM by executing the following command.

sudo kvm -m 256 -drive file=server.img,if=virtio,index=0 -boot c -net nic -net user -nographic -vnc :0

At this point, you can add all the packages you want to have installed, update the installation, add users and make any configuration changes you want in your image.

Uploading the Linux image

Upload the image

glance add name="" is_public=true container_format=ovf disk_format=qcow2 < 
.img

Creating a Windows Image

The first step would be to create an image on Client1, this will represent the main HDD of the virtual machine, so make sure to give it as much space as you will need.

kvm-img create -f qcow2 windowsserver.img 20G

OS Installation

OpenStack presents the disk using a virtio interface while launching the instance. Hence the OS needs to have drivers for virtio. By default, the Windows Server 2008 ISO does not have the drivers for virtio. Download the iso image containing virtio drivers from the following location and attach it during the installation

Start the installation by executing:

sudo kvm -m 1024 -cdrom windows2008.iso -drive file=windowsserver1.img,if=virtio -boot d -drive file=virtio-win-0.1-22.iso,index=3,media=cdrom  -device virtio-net-pci -net nic -net user -nographic -vnc :5

When the installation prompts you to choose a hard disk device you won't see any devices available. Click on "Load drivers" at the bottom left and load the drivers by browsing the secondary CDROM in which the virtio driver disk is loaded

After the installation is over, boot into it once and install any additional applications you need to install and make any configuration changes you need to make. Also ensure that RDP is enabled as that would be the only way you can connect to a running instance of Windows. Windows firewall needs to be configured to allow incoming ICMP and RDP connections.

 

Uploading the Windows image

Shut-down the VM and upload the image to OpenStack

glance add name="windows" is_public=true container_format=ovf disk_format=qcow2 < windowsserver.img

 

 

转载于:https://www.cnblogs.com/licheng/archive/2012/06/04/2534720.html

你可能感兴趣的文章
虚拟化与云计算也跳不出的成本怪圈——新时代下的“安迪-比尔定律”分析
查看>>
fedora 17 gnome 添加打开终端快捷键
查看>>
Redis源码系列28:ServerSocket接收到client的连接请求处理过程
查看>>
微信浏览器返回上一页停留在原位置
查看>>
nfs服务器的搭建和挂载使用
查看>>
我的友情链接
查看>>
jQuery怎么判断table里是否有可见的tr
查看>>
系统运行缓慢,CPU 100%,以及Full GC次数过多问题的排查思路
查看>>
fork()
查看>>
Java8 - 日期和时间实用技巧
查看>>
Java记录 -58- Iterator 迭代器
查看>>
RabbitMQ入门(5)--主题
查看>>
菜鸟如何使用GoEasy实现第一个web实时消息推送
查看>>
LNMMP架构的安装配置和功能的实现
查看>>
几个设置让你的邮箱不会爆满
查看>>
我的友情链接
查看>>
在linux6上安装RAC时多路径的权限设置
查看>>
[转载] 七龙珠第一部——第037话 忍者出现
查看>>
高并发—数据库自增主键解决(转)
查看>>
我的友情链接
查看>>