# 建立网络(provider)与子网
openstack network create --share --external --provider-physical-network provider --provider-network-type flat provider
openstack subnet create --network provider --allocation-pool start=10.0.0.11,end=10.0.0.20 --dns-nameserver 10.0.0.100 --gateway 10.0.0.0.1 --subnet-range 10.0.0.0/24 provider
openstack network list
openstack subnet list
# 建立flavor
openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.tiny
openstack flavor create --id 1 --vcpus 1 --ram 2048 --disk 10 m1.middium
openstack flavor list
# 建立key pair
ssh-keygen -q -N ""
openstack keypair create --public-key ~/.sshid_rsa.pub mykey
openstack keypair list
# 建立security group rule
openstack security group rulesou create --proto icmp default
openstack security group rule create --proto tcp dst-port 22 default
openstack security group rule list
# 建立instance
openstack server create --flavor m1.tiny --image cirros --nic net-id=PROVIDER_NET_ID --security-group default --key-name mykey instance01
openstack server create --flavor m1.middium --image centos7_x86 --nic net-id=PROVIDER_NET_ID --security-group default --key-name mykey instance02
openstack server list
# 验证
openstack console url show instance01
openstack console url show instance02
cirros / gocubsgo
centos /
# horizon修改实例密码
/etc/openstack-dashboard/local_settings.py
变更
OPENSTACK_HYPERVISOR_FEATURES = {
...
'can_set_password': False,
}
/etc/nova/nova.conf
[libvirt]添加
inject_password=true
实例默认密码
cirros / gocubsgo
centos /