supermao12

两边虚拟机时间不一样cinder会报错。

在computer节输入命令
ntpdate 192.168.10.100
systemctl restart openstack-cinder-volume

#!/bin/bash

source /etc/keystone/admin-openrc.sh

glance image-create --name centos_mqy --disk-format=qcow2 \
                            --container-format=bare --progress < /opt/iaas/images/CentOS_7.2_x86_64_XD.qcow2

#创建内外网络
neutron net-create  --shared --router:external=true net-mqy-gre
neutron net-create  --shared int-mqy-gre

#创建外网子网
#创建内网子网
neutron subnet-create net-mqy-gre 192.168.20.0/24 --name net-subnet01 --gateway 192.168.20.2  --dns-nameserver 8.8.8.8

neutron subnet-create int-mqy-gre 10.10.0.0/24 --name int-subnet01 --gateway 10.10.0.2

neutron router-create mqy

neutron router-gateway-set mqy net-mqy-gre
neutron router-interface-add mqy subnet=int-subnet01
#安全组创建以及添加规则
nova secgroup-create mqy  \'belong mqy\'
nova secgroup-add-rule mqy icmp -1 -1 0.0.0.0/0
nova secgroup-add-rule mqy udp 1 65535 0.0.0.0/0
nova secgroup-add-rule mqy tcp 1 65535 0.0.0.0/0

#云主机类型添加


openstack flavor create  --id 7 --ram 1024 --disk 10 --vcpus 1  mqy

#开启云主机
nova boot \
--image centos_mqy  \
--flavor mqy   \
--security-group mqy  \
--nic net-id=$(neutron net-list | grep int-mqy | awk \'{print $2}\')  \
supermao

#浮动ip池创建
nova floating-ip-create net-mqy-gre
nova floating-ip-associate supermao $(nova floating-ip-list | grep net|awk \'{print $4}\')

cinder create --name mqy 2

nova volume-attach supermao $(cinder list |grep mqy  | awk \'{print $2}\') /dev/vdb
#如果虚拟机没有创好时运行到这就会报错    

#nova delete $(nova list | awk \'NR<=3 {next} {print $2}\')

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-01-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2021-12-12
  • 2021-12-11
  • 2022-02-09
相关资源
相似解决方案