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

Openstack O version control node creates a network

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Four. create a network

[root@controller ~] # source admin-openrc

Create a public network in flat mode. Note that this public is an outgoing network and must be in flat mode.

[root@controller] # neutron-debug net-create-shared provider-router:external True-provider:network_type flat-provider:physical_network provider

Create a public network subnet named public-sub, the network segment is 192.168.0, and the IP range is 80-90 (this is usually the floating IP for VM), dns setting

192.168.0.254 and gateway 192.168.0.254

[root@controller] # neutron subnet-create provider 192.168.0 dns-nameserver 24-- name provider-sub-- allocation-pool start=192.168.0.80,end=192.168.0.90-- dns-nameserver 192.168.0.254-- gateway 192.168.0.254

Create a VPC named private with a network mode of vxlan

[root@controller] # neutron net-create private-provider:network_type vxlan-router:external False-shared

Create a VPC subnet named private-subnet with a network segment of 192.168.1.0, which is the private IP address obtained by the virtual machine.

[root@controller] # neutron subnet-create private--name private-subnet-- gateway 192.168.1.1 192.168.1.0 Universe 24

5. Create a route and operate it on the interface, as shown in the following figure:

Create an interface

# # comtroller##

1. Create an instance type in controller

[root@controller] # openstack flavor create m1.tiny-- id 1-- ram 512-- disk 1-- vcpus 1

[root@controller] # openstack flavor create m1.small-- id 2-- ram 2048-- disk 20-- vcpus 1

[root@controller] # openstack flavor create m1.medium-- id 3-- ram 4096-- disk 40-- vcpus 2

[root@controller] # openstack flavor create m1.large-- id 4-- ram 8192-- disk 80-- vcpus 4

[root@controller] # openstack flavor create m1.xlarge-- id 5-- ram 16384-- disk 160-- vcpus 8

two。 Check whether the nova deployment is normal

[root@controller ~] # nova-manage cell_v2 simple_cell_setup

Cell0 is already setup

[root@controller] # nova-manage cell_v2 list_cells-- verbose

[root@controller ~] # nova-status upgrade check

3. Create an instance on the web side

Problems in the construction process:

1. An error occurred when the instance was created, as shown in the figure above: the instance "test" failed to perform the requested operation, and the instance was in an error state. Please try [error: Failed to connect socket to'/ var/run/libvirt/virtlogd-sock': No such file or directory] later.

Solution:

On the compute node

[root@compute ~] # yum-y install qemu libvirt virt-manager

[root@compute ~] # vi / etc/libvirt/libvirtd.conf

85 unix_sock_group = "libvirt"

92 unix_sock_ro_perms = "0777"

102 unix_sock_rw_perms = "0770"

141 auth_unix_ro = "none"

150 auth_unix_rw = "none"

[root@compute ~] # systemctl enable virtlogd.service

[root@compute ~] # systemctl start virtlogd.service

[root@compute ~] # systemctl status virtlogd.service

● virtlogd.service-Virtual machine log manager

Loaded: loaded (/ usr/lib/systemd/system/virtlogd.service; indirect; vendor preset: disabled)

Active: active (running) since Tue 2017-06-06 17:23:34 CST; 7s ago

Docs: man:virtlogd (8)

Http://libvirt.org

Main PID: 9256 (virtlogd)

CGroup: / system.slice/virtlogd.service

└─ 9256 / usr/sbin/virtlogd

Jun 06 17:23:34 compute systemd [1]: Started Virtual machine log manager.

Jun 06 17:23:34 compute systemd [1]: Starting Virtual machine log manager...

# create a virtual machine here. If it is running in reality, it means the creation is successful.

Go to the console to see if you can log in to the newly created system

two。 After entering the console, starting up.... cannot be run, as shown in the following figure:

Check whether the nova service is working in compute. As shown in the following figure, the nova service is down and not up.

[root@compute ~] # systemctl status openstack-nova-compute.service

Check the log and find that the nova-compute.log log shows

[root@compute ~] # cat / var/log/nova/nova-compute.log | grep ERROR

2017-06-06 1715 50 var/run/libvirt/libvirt-sock': Permission denied 46.173 12295 ERROR nova.virt.libvirt.host libvirtError: Failed to connect socket to'/

2017-06-06 1715 50 ERROR oslo_service.service HypervisorUnavailable 46.195 12295: Connection to the hypervisor is broken on host: compute

Solution:

[root@compute] # chmod-R 777 / var/run/libvirt

Then restart the nova service

[root@compute ~] # systemctl restart openstack-nova-compute.service

[root@compute ~] # systemctl status openstack-nova-compute.service

● openstack-nova-compute.service-OpenStack Nova Compute Server

Loaded: loaded (/ usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)

Active: active (running) since Tue 2017-06-06 17:51:32 CST; 1s ago

Main PID: 12381 (nova-compute)

CGroup: / system.slice/openstack-nova-compute.service ├─ 12381 / usr/bin/python2 / usr/bin/nova-compute

├─ 12412 sudo nova-rootwrap / etc/nova/rootwrap.conf privsep-helper-config-file / usr/share/nova/nova-dist.conf-config-file / etc/nova/nova.conf-privsep_context vif_plug_linux...

├─ 12413 / usr/bin/python2 / usr/bin/nova-rootwrap / etc/nova/rootwrap.conf privsep-helper-config-file / usr/share/nova/nova-dist.conf-config-file / etc/nova/nova.conf-privsep_c...

└─ 12414 / usr/bin/python2 / bin/privsep-helper-config-file / usr/share/nova/nova-dist.conf-config-file / etc/nova/nova.conf-privsep_context vif_plug_linux_bridge.privsep.vif_p...

Jun 06 17:51:21 compute systemd [1]: Starting OpenStack Nova Compute Server...

Jun 06 17:51:32 compute systemd [1]: Started OpenStack Nova Compute Server.

Jun 06 17:51:33 compute sudo [12412]: nova: TTY=unknown; PWD=/; USER=root; COMMAND=/bin/nova-rootwrap / etc/nova/rootwrap.conf privsep-helper-- config-file / usr/share/no.../privsep.sock

Hint: Some lines were ellipsized, use-l to show in full.

It appears fine after recreating the virtual machine, as shown in the following figure:

3. After the created virtual machine is bound with a floating IP address, the assigned private network address cannot be accessed by ping. You need to add a security group policy and select the management rules as shown in the figure:

Select add rule, rule is: all ICMP protocols, and then select add.

Add ssh protocol and select add.

Access with xshell, as shown in the following figure: indicates success.

4. After adding the virtual machine, the instance created by the refresh page disappears, showing that the instance is empty.

Solution: restart the nova service on controller

[root@controller ~] # systemctl restart openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

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