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 distribute virtual machine and bind floating ip to log in in openstack

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

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to send virtual machines and bind floating ip to log in in openstack, I believe most people don't know much about it, so share this article for your reference. I hope you can learn a lot after reading this article. Let's learn about it together.

First, use openvswitch-based flat networks to connect external networks

In the test ring, using the openstack deployed by allinone, if you need to communicate with the external physical network, you need to configure the flat network. In version Q, neutron services use openvswitch by default instead of linux bridge.

Openvswitch supports five network types, including gre,local,flat,vxlan and vlan, among which gre network and vxlan are similar, using tunnel mode.

Local network: no physical network card is connected to the host, traffic is limited to the host, and there is no VLAN ID.

Flat network: a network without tag. The host network card is connected to the flat network through a bridge, and each flat network occupies a physical network card.

Vlan network: a network with tag. Under the implementation of openvswitch, the virtual network cards of different vlan instance will be connected to the br-int.

Gre and vxlan networks: overlay network based on tunneling technology, networks built on other networks.

The test environment uses flat networks to connect to external physical networks

First, set the relevant parameters in / etc/neutron/plugins/ml2/ml2_conf.ini, and specify that the network type of ordinary users is flat.

Vim / etc/neutron/plugins/ml2/ml2_ conf.ini [ml2] tenant_network_types=flat # modify tenaant_network_types to flat

Because when using packstack to deploy openstackallinone, the correspondence between the flat network and the physical network has been indicated. If you use a deployment that controls computing separation, you need to modify the configuration file to indicate the corresponding relationship, such as:

[ml2_type_flat] flat_networks= default [ovs] bridge_mappings=default:br-ex # specifies the corresponding external bridge br-ex

When finished, restart the neutron network service

Systemctl restart neutron-server

Then use the ovs-vsctl command to check the br-ex configuration

Ovs-vsctl show

About the ovs-vswitch internal network is roughly as follows:

Description:

1. Ens192 is a physical network card (using virtual vmware for nested deployment of openstack, relatively speaking, it is also a virtual network card in nature)

2. The external bridge br-ex is equipped with an ip address, which is used as an openstack login and issue virtual machine.

3. The issued virtual machine first needs to obtain the private network ip address through the dhcp provided by neuntron, and then access the public network through snat through router.

2. Floating ip

The DHCP server assigns a private IP address to the network interface of the instance. By using commands such as "ip a", you can see the address in the instance. This address is usually part of a private network and is used to communicate between instances in the same broadcast domain through a virtual switch (an L2 agent on each compute node). It can also be accessed from instances in other private networks through a virtual router (L3 proxy).

Floating IP address is a service provided by Neutron. It does not use any DHCP services or is statically set in the guest virtual machine. In fact, the customer's operating system does not know that it is assigned a floating IP address. It is the responsibility of Neutron's L3 agent to deliver packets to the interface using the specified floating address. An instance with a specified floating IP address can be accessed from the public network through a floating IP.

The OpenStack instance receives a private IP address through which IP they can contact each other and which hosts can access them. In order to access these instances from other computers in the network, such as workstations, you need to assign a floating IP to the instance. Packstack automatically misconfigures your network using the default settings. You need to configure the OpenStack installation with a range of free IP addresses suitable for your network.

A brief description:

1. Configure the flat network in the external network to ensure that openstack can access the external physical network.

2. Floating ip is the actual physical ip address range available, which refers to the public network ip that the virtual machine instance can be bound to. In the public cloud, it means elastic IP. The test environment is the corresponding physical address range, such as 172.31.208.110.

After completing all the basic network configuration above, you can see the network topology in dashbord

Description:

1. External_network connects to the external physical network, using flat network mode, 172.31.208.0U24

Router router is a virtual router that connects an external network to a virtual network

3. An interface on router corresponds to the address of the external physical network 172.31.208.102. The virtual machine instance will use snat in the virtual private network, to the external network, and then can access the external network.

4. The other interface on the router corresponds to the virtual private network. The dhcp service of 192.168.1.0 Universe 24 Magimon will assign an address to the virtual machine instance.

3. Issue virtual instances and bind floating ip

External network configuration, image upload and other configurations have been completed.

Test using floating IP 172.31.208.110

Tenant Project cloud

Tenant administrator vdc_admin

3.1 assign floating ip

Log in to dashbord as admin, and assign a floating ip172.31.208.110 to the project cloud in Administrator-Network-floating IP

You can assign multiple floating ip to the project. The address range should be within the address range configured in the external network flat. Click assign floating ip.

3.2 create a virtual machine instance

Log in to the project cloud as tenant administrator vdc_admin, and then click create instance in calculation

I have already explained how to create an instance, but I will not explain it this time.

After successful creation, start binding floating ip

Then select the assigned floating ip

Then we need to modify the rules in the network-security group. The inbound direction can be opened through tcp port 22, and then we can perform ssh services to the virtual machine instance through the floating IP.

This completes the configuration of floating ip and instance, and you can log in through floating ip 172.31.208.110.

Virtual machine instance tested

User name cirros

Password cubswin:)

Then you can see that you can access the instance and the public network at the same time

At this point, we look at the network topology

Fourth, bind the volume

At this point, the test instance has only one hard disk, and we need volume service to generate cloud disk (evs).

Create a 10G volume as a cloud disk

Then we bind to the instance

After binding, the volume is used as a cloud disk or a virtual block device, which needs to be formatted and mounted.

Sudo fdisk / dev/vdbsudo mkfs.ext3 / dev/vdb1sudo mount / dev/vdb1 / vardf-h

You can see that it has been mounted.

These are all the contents of the article "how to distribute virtual machines and bind floating ip to login in openstack". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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

Wechat

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

12
Report