Management Virtual Machine of OpenStack (7)
The three components (four nodes) of OpenStack have been safely built. This blog article brings you basic management and makes platform management more convenient and effective.
I. Mirror Management
1. Mount / upload the mirror to the control node
Mkdir / abc
Mount.cifs / / 192.168.37.1/rhel7/KVM/CentOS-7-x86_64-DVD-1708.iso / abc
2. Convert native ISO image format to qcow2
Openstack image create-disk-format qcow2-container-format bare-public-file / abc/rhel7/KVM/CentOS-7-x86_64-DVD-1708.iso CentOS-7-x86_64
3. View the image information created.
Openstack image list
Second, create a virtual machine process
1. Create a network provider
Source ~ / admin-openrcopenstack network create-- share-- external-- provider-physical-network provider--provider-network-type flat provider parameter:-- share allows all projects to use virtual networks-- external defines external virtual networks if you need to create an external network, use-- internal--provider-physical-network provider & &-- provider-network-type flat to connect to the flat virtual network.
2. Create a subnet
Openstack subnet create-- network provider-- allocation-pool start=192.168.37.50,end=192.168.37.100-- dns-nameserver 114.114.114.114-- gateway 192.168.37.254-- subnet-range 192.168.37.0 subnet-range 24 provider
3. Create a CVM specification flavor
Openstack flavor create-- id 1-- vcpus 4-- ram 128-- disk 1 m2.nano
4. The control node generates a secret key pair. Before starting the instance, you need to add the public key to the Compute service.
Source ~ / demo-openrc
Ssh-keygen-Q-N ""
Openstack keypair create-public-key ~ / .ssh/id_rsa.pub zhangkey
5. Add security groups to allow ICMP (ping) and security shell (SSH)
Openstack security group rule create-proto icmp default
6. Allow secure shell (SSH) access
Openstack security group rule create-proto tcp-dst-port 22 default
7. List flavor
Openstack flavor list
8. List available images
Openstack image list
9. List the network
Openstack network list
10. List security groups
Openstack security group list
Create a virtual machine
Openstack server create-flavor m2.nano-image cirros-nic net-id=c636f502-f93f-4e48-8e1e-53402ea3ba4e-security-group default-key-name chenkey provider-instance
12. View the status of the real column
Openstack server list
13. Test: view the instance