In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Pike version of Openstack virtual machine command line specified ip address example analysis, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
View the existing network interface (corresponding to the virtual machine Nic)
#. Admin-openrc
By viewing admin permissions, you can see more tenant id tenant_id.
# neutron port-listneutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.+--+-+--+-+- -+ | id | name | tenant_id | mac_address | fixed_ips | | +-- +-- -+-+ | 00401677-543c-4834-9f30-d25e179e88a0 | | 9c658f84358140378e637f0b27c7ca57 | | fa:16:3e:e0:d1:c2 | {"subnet_id": "c26fc89c-44ce-492b-aa88-befe9bae942c" | "ip_address": "172.16.40.134"} | | e6480311-3226-49fc-8964-a15237d6ff14 | | 9c658f84358140378e637f0b27c7ca57 | fa:16:3e:67:01:eb | {"subnet_id": "c26fc89c-44ce-492b-aa88-befe9bae942c" "ip_address": "172.16.40.108"} | +-- +-+ -+
The average tenant cannot see the tenant id.
#. Tbg-openrc # neutron port-listneutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.+--+ -- + | id | name | mac_address | fixed_ips | +- -+- -+ | 00401677-543c-4834-9f30-d25e179e88a0 | | fa:16:3e:e0:d1:c2 | {"subnet_id": "c26fc89c-44ce-492b-aa88-befe9bae942c" "ip_address": "172.16.40.134"} | | e6480311-3226-49fc-8964-a15237d6ff14 | | fa:16:3e:67:01:eb | {"subnet_id": "c26fc89c-44ce-492b-aa88-befe9bae942c" "ip_address": "172.16.40.108"} | +-- -- +
Create a network interface with admin permission to specify the tenant, the ip address, and the corresponding network
#. Admin-openrc # neutron port-create-tenant-id 9c658f84358140378e637f0b27c7ca57-fixed-ip ip_address='172.16.40.104' providerneutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.Created a new port:+---+- -+ | Field | Value | + -+ | admin_state_up | True | | allowed_address_pairs | | | binding:host_id | binding:profile | {} | | | binding:vif_details | {} | | binding:vif_type | unbound | | binding:vnic_type | normal | | | created_at | 2018-02-27T07:42:08Z | | description | | | device_id | device_owner | Extra_dhcp_opts | | fixed_ips | {"subnet_id": "c26fc89c-44ce-492b-aa88-befe9bae942c" "ip_address": "172.16.40.104"} | | id | 5e993bfd-219b-4e0e-9173-721e072e7342 | | mac_address | fa:16:3e:d8:40:0a | | name | | network_id | c35672ab-6d14-4fd6-99a5-5b912ae1070a | | port_security_enabled | True | | | project_id | 9c658f84358140378e637f0b27c7ca57 | | revision_number | 3 | | security_groups | e437d647-4c0e- 42c4-bc40-f15d15364748 | | status | DOWN | | tags | | | tenant_id | 9c658f84358140378e637f0b27c7ca57 | | updated_at | 2018-02-27T07:42:08Z | +- -+
Connect the newly created port to the virtual machine
# nova list+--+----+ | ID | | Name | Status | Task State | Power State | Networks | +-- -+-+ | eddcb46e-eac5-4403-83a8-1f0d8ac34439 | hadoop-4 | ACTIVE |-| Running | provider=172.16.40.134 | | 06a43249-9258-409e-b791-541396771a9d | zxq-3 | ACTIVE |-| Running | provider=172.16.40.108 | +- -+
Add a connection, and if you do not specify a port-id, you will create a new
# nova interface-attach-- port-id 5e993bfd-219b-4e0e-9173-721e072e7342 eddcb46e-eac5-4403-83a8-1f0d8ac34439# nova interface-list eddcb46e-eac5-4403-83a8-1f0d8ac34439 -+ | Port State | Port ID | Net ID | IP addresses | MAC Addr | +-+- -- +-+ | BUILD | 00401677-543c-4834-9f30-d25e179e88a0 | c35672ab- 6d14-4fd6-99a5-5b912ae1070a | 172.16.40.134 | fa:16:3e:e0:d1:c2 | | BUILD | 5e993bfd-219b-4e0e-9173-721e072e7342 | c35672ab-6d14-4fd6-99a5-5b912ae1070a | 172.16.40.104 | fa:16:3e:d8:40:0a | +-- -+-+
Detach interface
# nova interface-detach eddcb46e-eac5-4403-83a8-1f0d8ac34439 00401677-543c-4834-9f30-d25e179e88a0# ping 172.16.40.104PING 172.16.40.104 (172.16.40.104) 56 (84) bytes of data.64 bytes from 172.16.40.104: icmp_seq=1 ttl=64 time=3.11 ms
Can ping, add the specified ip is normal.
This is the answer to the sample analysis question about the ip address specified by the command line of the Pike version of Openstack virtual machine. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.