Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create a VM on the OpenStack platform?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Log in to the OpenStack environment (Web environment or command line environment) with an account that has permission to create VM

The account initiates a request to create a VM. After the Keystone authentication is passed, it is sent to the account token.

The account creates a VM by calling nova-api based on token

Nova-api sends the VM resource information to be created by the account to nova-scheduler, and nova-scheduler dispatches the VM bearer machine.

The nova-compute on the host machine gets the flavor from nova-conductor and requests an image from glance-api

Glance-api acquires image location and other information from glance-registry and feeds it back to nova-compute on the host machine.

Nova-compute initiates a network creation request to neutron-server

According to the message sent by neutron-server, neutron-plugins finds the resource information of the network being built, and transmits it to neutron-agents to create

Neutron-server feedback the creation result of neutron-agents to nova-compute on the host machine.

The nova-compute on the host machine initiates a persistent storage request to the cinder-api and communicates it to the cinder-scheduler, where the cinder-scheduler dispatches the host machine.

The cinder-volume of the host machine scheduled by cinder-scheduler calls the back-end storage driver to create a persistent storage device and feed back the creation result to cinder-api

So far, the computing, system mirroring, network, storage and other resources needed to create VM are available.

Nova-compute calls KVM, XEN, VMware and other hypervisor to create VM instance

At this point, users can start and test the newly created VM instance and use it after proper configuration.

When creating a VM instance, the target image must be stored in the Glance. The ISO image obtained through the LinuxOS official website cannot be directly used in the OpenStack environment. Generally, the ISO image is installed in a virtual machine for customization, the MAC address record file is deleted and exported to qcow2 format, and then uploaded to Glance for storage.

Example: create a CentOS official cloud image VM instance

Go to the CentOS official website to download the cloud image in qcow2 format, http://cloud.centos.org/centos/7/images/

Execute a custom environment variable script, which is roughly as follows:

Export OS_TENANT_NAME=adminTenant

Export OS_USERNAME=admin

Export OS_PASSWORD=openstack

Export OS_AUTH_URL= http://****

Execute the command:

Wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1802.qcow2c

Upload CentOS cloud image to Glance

Glance image-create-name centos71802-disk-format qcow2-container-format bare-is-public True-file / images/CentOS-7-x86_64-GenericCloud-1802.qcow2c

View mirrors stored in Glance

Glance image-list

View system service status

Nova service-list

View network resources

Nova network-list

View mirror resources

Nova image-list

View Flavor constraints

Nova flavor-list

Configure the firewall, turn on SSH and ICMP

Nova secgroup-list

Nova secgroup-add-rule Security Group tcp 22 22 0.0.0.0 Universe 0

Nova secgroup-add-rule Security Group icmp-1-1 0.0.0.0 Universe 0

Nova secgroup-list-rules Security Group

Get keypair

Nova keypair-list

Create a VM instance

Nova boot-- image image value-- flavor template value-- nic net-id= network value-- security-groups security group value-- hostname and Zone name of the availability-zone host-- key-name username instance name

View the creation of VM instances

Nova list

Get VNC console commands

Nova get-vnc-console instance name novnc

At this point, you can access the VM instance through the Web page, logging in with the user name and password you used when you created the VM.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report