centos单机安装配置openstack

基本工具

安装gedit工具,方便之后的复制等工作,要是熟悉vi也可以不安装

yum install gedit -y

安装vncviewer。因为当时安装的时候选择最小桌面安装,所以没有自带的vnc工具,查看了完整的桌面安装,使用的是TigerVNC

yum install tigervnc -y

同样,之后需要制作镜像,所以镜像在U盘中,就需要安装ntfs格式支持

yum install ntfs-3g

假如不行,可尝试:

1、下载rpmforgerpm文件包

32位系统

[root@linuxsight linuxsight]#  wgethttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-1.el6.rf.i686.rpm

64位系统

[root@linuxsight linuxsight]#  wgethttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

2、安装rpmforgerpm文件包

[root@linuxsight linuxsight]#  rpm -ivhrpmforge-release-0.5.2-1.el6.rf.i686.rpm(目录请对应,区分3264,这里是32位)

3、安装ntfs-3g

参考:http://hi.baidu.com/a381243429/item/a6a21e33453016f8de222116

 

 

先配置网络:

我的本机网路是192.168.10.80,最好是手动分配IP

几种方式配置都可以

1sudosetup

2vi/etc/sysconfig/network-scripts/ifcfg-eth0;

3:网络编辑器

 

运行 service network restart

 

进入主题:

正式安装openstack:

openstack.redhat.com

 

sudo yum install -y http://rdo.fedorapeople.org/rdo-release.rpm

 

sudo yum install -y openstack-packstack

 

在执行第三步之前,可以使用这个命令,用于产生answer-file,这样就可以按照自己的需要修改password等。

packstack --gen-answer-file

 

packstack --allinone

 

中间出现断网情况的话,新建terminal,直接sudo service networkrestart

 

中间假如安装失败:If you have run packstack previously, there will bea file in your home directory named something likepackstack-answers-20130722-153728.txt You will probably want to usethat file again, using the --answer-file option, so that anypasswords you've already set (eg, mysql) will bereused.

 

配置网络:

1:删除所有的原有配置网络

注意:需要保证NetworkManager已经关闭 serviceNetworkManager stop

2Aftercompletion, given a single machine with a current IP of192.168.122.212/24 via DHCP with gateway of 192.168.122.1:
Make /etc/sysconfig/network-scripts/ifcfg-br-ex resemble: (notethis file shouldn't exist, but does due to a bug)
DEVICE=br-ex
DEVICETYPE=ovs
TYPE=OVSBridge
BOOTPROTO=static
IPADDR=192.168.122.212 # Old eth0 IP since we want the networkrestart to not kill the connection, otherwise pick somethingoutside your dhcp range
NETMASK=255.255.255.0 # your netmask
GATEWAY=192.168.122.1 # your gateway
DNS1=192.168.122.1 # your nameserver
ONBOOT=yes

 

3Make/etc/sysconfig/network-scripts/ifcfg-eth0 resemble (noBOOTPROTO!):
DEVICE=eth0
HWADDR=52:54:00:92:05:AE # your hwaddr
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=br-ex
ONBOOT=yes

 

4Addto the /etc/neutron/plugin.ini file these lines:
network_vlan_ranges = physnet1
bridge_mappings = physnet1:br-ex

 

Restart the networkservice
# service network restart

 

参考:http://openstack.redhat.com/Neutron_with_existing_external_network

 

Neutron net-create public--router:External//创建public网络,必须设置为external

Neutron net-createprivate//创建private网络

 

创建floatingip,注意这里是cidr进行网关的编码,所以这里最好能够自己根据自己的路由情况设置,具体参考http://en.wikipedia.org/wiki/CIDR_notation

source/root/keystonerc_admin

nova floating-ip-bulk-delete 10.3.4.0/22 (this is the hard-codedrange in packstack)

nova floating-ip-bulk-create CORRECT-RANGE (in the above example,this would be 192.168.1.56/29)

nova-manage floating list (to see your new list of floatingIPs)

 创建子网络

source /root/keystonerc_admin

neutron subnet-create public 192.168.1.0/24 --name public_subnet--enable_dhcp False --allocation_poolstart=192.168.1.57,end=192.168.1.62 --gateway 192.168.1.1(这里就需要按照上一步的floating-ip的范围来填写参数)

 

neutron subnet-create private 192.168.1.0/24 --name private_subnet--enable_dhcp False --allocation_poolstart=192.168.1.57,end=192.168.1.62 --gateway 192.168.1.1(私网的就很随意了)

 

neutron router-gateway-set $router_id $vlan_id (这里是设置公网为路由的网关)

 

以上命令都可以转为在dashboard里面进行(红色除外)

添加节点:

 

制作镜像

只介绍window安装,环境为centos

1.   qemu-imgcreate -f qcow2 winxp.img 3G

2.   sudo/usr/libexec/qemu-kvm -m 512 -cdrom winxp.iso -drivefile=winxp.img,if=virtio -fda virtio-win.vfd -boot d注意不要添加了nographic

3.   VNCClient 安装WinXP

4.   sudo/usr/libexec/qemu-kvm -m 512 -drive file=winxp.img,if=virtio-cdrom virtio-win-1.1.16.iso -netnic,model=virtio  -boot c

5.   上传镜像

 glance add name="winxp" is_public=true container_format=ovfdisk_format=qcow2 < filename.img

 

 

 

 

制作linux镜像

http://www.unixhot.com/thread-388-1-1.html

 

注意的一个问题就是需要删除网络配置文件中的mac地址,这样就可以防止多个启动的时候产生mac地址冲突导致不能上网的问题,这个是和vmware不一样的地方

 

 

glance image-download --file filename.img

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值