对上面进行补充
虚拟网络命令- brctl
- virsh
- tgtadm --lld iscsi --op show --mode target 控制节点查看target
- tgtadm --op new --lld=iscsi --mode=target --tid=1 --targetname=iqn.2010-10.org.openstack:volume-00000001 建立target
复制代码
nova 挂接实例/分区- sudo nova-rootwrap guestmount --rw -a /home/instances/instance-0000001b/disk -m /dev/sda1 /tmp/tmpfe4fNg
复制代码
配置:nova.conf- ##################filter#############
- #scheduler_default_filters=AvailabilityZoneFilter,RamFilter,ComputeFilter,IsolatedHostsFilter
- #isolated_hosts=hyops2.elex.com
- #isolated_images=ee30929c-a3bb-42a7-a494-9a77ae501c54
复制代码
配置于nova.conf
规定在某个images上创建的实例位于固定计算节点主机
重新初始化nova库:
停止控制和计算节点的nova服务,删除/home/instances目录下的文件- nova-manage network delete 192.168.193.0/24
- nova-manage network delete 10.18.4.0/24
- mysql -uroot -p
- mysql> drop database nova
- mysql> create database nova;
- mysql> grant all privileges on nova.* to 'nova_user'@'%' identified by 'nova_pw3465';
- nova-manage db sync
- nohup /usr/bin/python /usr/bin/nova-all >> /var/log/nova.log 2>&1 &
- nova-manage network create --label=public --fixed_range_v4=10.18.4.0/24 --num_networks=1 --network_size=256 --gateway=10.18.4.254 --bridge=br_pu --bridge_interface=em1 --multi_host='F'
- nova-manage network create --label=private --fixed_range_v4=192.168.193.0/24 --num_networks=1 --network_size=256 --gateway=192.168.193.1 --bridge=br_pr --bridge_interface=em2 --multi_host='F'
复制代码
设置安全策略- nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
- nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
- nova secgroup-list
- nova secgroup-list-rules default
复制代码
上传镜像- glance add name="CentOS-6.3_Fina_qcow2" is_public=true container_format=bare disk_format=qcow2 < CentOS-6.3_Fina_qcow2.img
- glance add name="CentOS-6.3_Fina_raw" is_public=true container_format=bare disk_format=raw < CentOS-6.3_Fina_raw.img
复制代码
|