1.用ubantu-14.04.3建一台虚拟机 ssh服务需要自己开启
2.在opt目录下克隆devstack源码git clone [url]https://github.com/openstack-dev/devstack.git[/url]
3.创建stack用户
4.修改配置文件
5.stack用户
magnum 基本操作
2.在opt目录下克隆devstack源码git clone [url]https://github.com/openstack-dev/devstack.git[/url]
3.创建stack用户
su root
cd /opt/devstack/tools
./create-stack-user.sh
vim /etc/sudoers 配置文件中加入下面一行stack ALL=(ALL:ALL) ALL
mv devstack/ /home/
chown -R stack:stack /home/devstack/
4.修改配置文件
mv /home/devstack/samples/local.conf /home/devstack
vim local.conf
[[local|localrc]](增加以下几行,其中HOST_IP是本机IP)
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 neutron
enable_service tempest
HOST_IP=192.168.139.171
FIXED_RANGE=10.24.0.0/24
NETWORK_GATEWAY=10.24.0.1
LOGDAYS=2
LOGDIR=$DEST/logs
LOGFILE=$LOGDIR/stack.sh.log
AMDIN_PASSWORD=mima
MYSQL_PASSWORD=$AMDIN_PASSWORD
RABBIT_PASSWORD=$AMDIN_PASSWORD
SERVICE_PASSWORD=$AMDIN_PASSWORD
SERVICE_TOKEN=$AMDIN_PASSWORD(注释掉DATABASE_PASSWORD=$AMDIN_PASSWORD SCREEN_LOGDIR=$LOGDIR/screen)
5.stack用户
cd /home/devstack$ ./stack.sh
magnum 基本操作
source ./openrc admin admin
cd ~
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
NIC_ID=$(neutron net-show public|awk '/id/{print $4}')
magnum baymodel-create -name testbaymodel -image-id fedora-21-atomic-3
-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 testbay -baymodel testbaymodel -ode-count 2
magnum bay-list
haoning8b667fb1-7bba-43bb-b365-0000b73b7b63 my885ae860-2b4e-4db5-856e-00cd2d3366a5
magnum baymodel-create --name testbaymodel --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 baymodel-create --name testbaymodel --image-id fedora-21-atomic-5 --keypair-id testkey --external-network-id e1075a5b-a7a5-4f26-9f06-bd6046eb61b4 --dns-nameserver 8.8.8.8 --flavor-id m1.small --docker-volume-size 5 --coe kubernetes
magnum bay-create --name testbay --baymodel testbaymodel --node-count 2
neutron net-show public
magnum pod-create --manifest ./redis-master.yaml -bay testbay