使用devstack安装magnum

阅读更多
在redhat6.5上建立个centos7的虚拟机,使用centos7安装带magnum的devstack

systemctl stop firewalld
systemctl disable firewalld
iptables -F
关闭selinux

qemu-img create -f qcow2 zhycentos.img 500G 
qemu-img amend -f qcow2 -o compat=0.10 zhycentos.img 
virsh define zhycentos.xml
virsh start zhycentos

其中zhycentos.xml
内容为:
  
  zhycentos  
  d06d7213-9b3d-f32e-f54a-70a82115242e  
  67108864  
  67108864  
  16  
    
    hvm  
      
       
    
    
      
      
      
    
    
  destroy  
  restart  
  restart  
    
    /usr/libexec/qemu-kvm  
      
        
        
        
      
      
        
        
        
        
      



安装系统后
进入系统
dhclient获取ip
selinux,iptables关闭
yum update
yum install gcc gcc-c++
#不要乱yum乱七八糟的东西,会有版本冲突。
yum install -y git  # 安装git
cd /home
git clone https://github.com/openstack-dev/devstack.git 
 
cd /home/devstack/tools/    # devstack默认不能以root身份运行
./create-stack-user.sh      # 会创建一个stack用户
chown -R stack. /home/devstack


cd /home/devstack
cp /home/devstack/sample/local.conf .


修改local.conf为
[root@magnum devstack]# cat local.conf 
[[local|localrc]]
enable_plugin magnum https://github.com/openstack/magnum master

disable_service n-net
enable_service  q-svc
enable_service  q-agt
enable_service  q-dhcp
enable_service  q-l3
enable_service  q-meta
enable_service  tempest

HOST_IP=192.168.139.221
FIXED_RANGE=10.24.0.0/24
NETWORK_GATEWAY=10.24.0.1
LOGDAYS=2
LOGDIR=$DEST/logs
LOGFILE=$LOGDIR/stack.sh.log
SCREEN_LOGDIR=$LOGDIR/screen
ADMIN_PASSWORD=haoning
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SREVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=haoning
[root@magnum devstack]# 


运行stack.sh
如果出现python的版本问题
sudo pip install <模块名>==<版本号>

简单测试
cd /home/devstack
source ./openrc admin admin
nova list
neutron net-list
test -f ~/.ssh/id_rsa.pub || ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
nova keypair-add --pub-key ~/.ssh/id_rsa.pub testkey
nova keypair-list

NIC_ID=$(neutron net-show public |awk '/ id / {print $4}')
magnum baymodel-create --name kubernetes --image-id fedora-21-atomic-5 --keypair-id testkey --external-network-id $NIC_ID --dns-nameserver 8.8.8.8 --flavor-id m1.small --docker-volume-size 5 --coe kubernetes

magnum bay-create --name k8s_bay --baymodel kubernetes --node-count 1

magnum bay-list   

magnum bay-show 1743df67-1da4-455c-ae43-3f66596f5964



使用devstack安装magnum_第1张图片
  • 使用devstack安装magnum_第2张图片
  • 大小: 71.5 KB
  • 查看图片附件

你可能感兴趣的:(devstack,openstack,qemu)