OpenStack部署笔记和安装WindowsXP镜像

以下是本人最近两周搭建OpenStack的心得与笔记,参考了网上很资料,终于搭建完成,途中遇到过很多问题,比如stack.sh执行中途出错问题,系统安装vnc连接问题,建云主机蓝屏问题,后来都慢慢解决了,供各位网友参考。


1. 系统为 ubuntu-14.04.1 amd64 位版本 ,电脑单网卡就可以了,不需要双网卡。

2. sudo apt-get update

3. sudo apt-get upgrade

4. sudo apt-get install python-netaddr git openssh-server

5. git clone git://github.com/openstack-dev/devstack.git

6. cd devstack; ./stack.sh


根据提示输入一堆密码,直接安装完毕,如果中途出错,可能是下载源的问题,注意看错误提示,再执行一次git clone git://xxxxx成功后,再执行./stack.sh,接着弄。

7 访问 http://服务器的IP ,用户名 admin 密码就是你上面输入的。



如果服务器重启后了,得执行如下命令进行恢复:

cd devstack; ./rejoin-stack.sh

------------------------------------------------------------------------------------------

8. 经过上面几步,环境就搭好了,然后得创建镜像并建云主机,可以在其它电脑上折腾


9. 安装相关软件 sudo apt-get install python-novaclient python-glanceclient swift qemu-kvm

10.设置环境变量:

export SERVICE_TOKEN=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=你的密码
export OS_AUTH_URL="http://服务器IP:5000/v2.0/"
export SERVICE_ENDPOINT="http://服务器IP:35357/v2.0"

11.创建一个img文件

qemu-img create -f qcow2 windowsxp.img 10G

12.下载virtio驱动

wget http://alt.fedoraproject.org/pub/alt/virtio-win/archives/virtio-win-0.1-59/virtio-win-0.1-59.iso
wget http://www.linuxwind.org/download/virtio-win-1.1.16.vfd

13.启动安装程序

sudo kvm -m 1024 -cdrom windowsxp.iso -drive file=windowsxp.img,if=virtio,boot=on -fda virtio-win-1.1.16.vfd -boot d -nographic -vnc :0

14.使用vnc连接安装系统

15.安装网卡驱动

系统装完之后,需要安装网卡驱动,先关闭XP系统,然后输入以下命令

sudo kvm -m 1024 -cdrom virtio-win-0.1-59.iso -drive file=windowsxp.img,if=virtio,boot=on -net nic,model=virtio -boot d -nographic -net user -usb -usbdevice tablet -vnc :0


进入虚拟机以后,到设备管理器里,从CD-ROM中搜索安装网卡驱动

16.上传镜像

glance image-create --name="WindowsXP" --is-public=true --container-format=ovf --disk-format=qcow2 < windowsxp.img

17.这时就可以到web界面上建云主机了。




  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Qemu 1.0.1 Windows QEMU emulator version 1.0.1, Copyright (c) 2003-2008 Fabrice Bellard usage: qemu [options] [disk_image] 'disk_image' is a raw hard disk image for IDE hard disk 0 Standard options: -h or -help display this help and exit -version display version information and exit -machine [type=]name[,prop[=value][,...]] selects emulated machine (-machine ? for list) property accel=accel1[:accel2[:...]] selects accelerator supported accelerators are kvm, xen, tcg (default: tcg) -cpu cpu select CPU (-cpu ? for list) -smp n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets] set the number of CPUs to 'n' [default=1] maxcpus= maximum number of total cpus, including offline CPUs for hotplug, etc cores= number of CPU cores on one socket threads= number of threads on one CPU core sockets= number of discrete sockets in the system -numa node[,mem=size][,cpus=cpu[-cpu]][,nodeid=node] -fda/-fdb file use 'file' as floppy disk 0/1 image -hda/-hdb file use 'file' as IDE hard disk 0/1 image -hdc/-hdd file use 'file' as IDE hard disk 2/3 image -cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master) -drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i] [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off] [,cache=writethrough|writeback|none|directsync|unsafe][,format=f] [,serial=s][,addr=A][,id=name][,aio=threads|native] [,readonly=on|off] use 'file' as a drive image -set group.id.arg=value set parameter for item of type i.e. -set drive.$id.file=/path/to/image -global driver.property=value set a global default for a driver property -mtdblock file use 'file' as on-board Flash memory image -sd file use 'file' as SecureDigital card image -pflash file use 'file'

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值