OpenStack命令删除虚拟机指定端口IP

2020-06-13 12:34:04 浏览数 (1)

首先查看server列表---查看需要删除哪个机器的IP

[root@controller ~]# openstack server list

ID

Name

Status

Networks

Image

Flavor

748a2e6d-083b-4965-a616-170d1a2bc0d4

Ke'Hu-5

ACTIVE

public=42.51.77.21; private=10.0.0.26

基础型

1fef3e0d-c640-4164-b868-6b9dbcdcc7df

Ke'Hu-1

ACTIVE

public=42.51.77.20; private=10.0.0.17

基础型

3b7120d9-579b-4910-9301-6e6364656e53

Ke'Hu-3

ACTIVE

public=42.51.77.15; private=10.0.0.20

基础型

7b383073-5f0c-43ab-8991-421eb2bac3e8

Ke'Hu-4

ACTIVE

public=42.51.77.4; private=10.0.0.9

基础型

b4500423-62fc-455e-b0f5-13fa4c4f5d58

Ke'Hu-2

ACTIVE

public=42.51.77.12; private=10.0.0.10

基础型

439fa0e0-c747-42e5-9abd-80c8e1e20776

ROLY-7

ACTIVE

public=42.51.77.19; private=10.0.0.11

基础型

8a425d87-f53a-4a37-9365-b98daae062bb

ROLY-9

ACTIVE

public=42.51.77.18; private=10.0.0.38

基础型

0a6a2d71-38d0-4a30-8f36-92886dcf980c

ROLY-5

ACTIVE

public=42.51.77.3; private=10.0.0.16

基础型

b8095ceb-005c-4ca8-88be-dbdd7bec39ac

wocaoname

ERROR

public=42.51.77.16

基础型

查看端口IP列表

[root@controller ~]# openstack port list

ID

Name

MAC Address

Fixed IP Addresses

Status

0e59952e-8ece-4bb3-8f9e-48b1c790fe16

fa:16:3e:46:9a:80

ip_address='10.0.0.2', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

19136274-b455-4598-b264-5c928aaf73c4

fa:16:3e:2f:8b:aa

ip_address='42.51.77.11', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

1a17b738-9179-4972-8836-53b90d1750e0

fa:16:3e:c4:7e:79

ip_address='42.51.77.15', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

1f1dda74-0aec-497f-84e4-6e6626b06f72

fa:16:3e:66:2f:bd

ip_address='10.0.0.5', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

1f65a5a9-fb48-4d5c-af6a-0b34a30f85fa

fa:16:3e:20:be:13

ip_address='42.51.77.16', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

DOWN

24ea5e26-95e6-4c9e-bd24-42335359a7c8

fa:16:3e:c9:2a:16

ip_address='42.51.77.3', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

2ededcbd-6e3c-4f97-89dc-404dae75aa0c

fa:16:3e:6e:ac:fa

ip_address='42.51.77.12', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

3bae352b-916e-43b3-a8c6-80ce801ce1a3

fa:16:3e:c6:17:07

ip_address='42.51.77.18', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

404d6133-0cce-4f07-aa27-04c90a6d0e37

fa:16:3e:e1:66:1c

ip_address='10.0.0.1', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

55892657-87a4-4631-8b10-c8fbe9d74987

fa:16:3e:a9:f3:c2

ip_address='10.0.0.20', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

6e293e06-83eb-452c-aa54-9deedc2888f4

fa:16:3e:69:fc:9d

ip_address='42.51.77.4', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

7f4cdfe7-401c-40ac-864d-b23500950544

fa:16:3e:99:ef:af

ip_address='10.0.0.38', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

8e6588ae-abf5-40fa-a49d-3545949173e2

fa:16:3e:1e:1e:e2

ip_address='10.0.0.10', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

97431fa6-6f8c-4df2-b90d-032b509f906f

fa:16:3e:01:49:1e

ip_address='42.51.77.21', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

98d141e0-3d0d-4d41-a896-39d0132dd631

fa:16:3e:d2:0d:47

ip_address='10.0.0.17', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

af97265b-9dc5-482e-a4fc-dd705912f4b6

fa:16:3e:6d:64:68

ip_address='42.51.77.20', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

b1090b7b-b9ed-497b-9cb4-e8b03bb4c0f2

fa:16:3e:a4:c0:8e

ip_address='10.0.0.26', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

d3d93d07-7bb5-49a3-af9c-c2d705091686

fa:16:3e:7b:74:fd

ip_address='42.51.77.19', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

d7e7d03d-55bc-4567-893b-5df19b6de78b

fa:16:3e:cc:54:a9

ip_address='10.0.0.16', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

f65e5232-ca19-4a09-b9ff-df100295c060

fa:16:3e:9a:4f:b5

ip_address='10.0.0.9', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

fe60dd7c-0edf-4fb9-a444-3e857f6e8268

fa:16:3e:9c:41:77

ip_address='10.0.0.11', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

ff7fffec-c66a-4b06-bfad-90a932a12a4b

fa:16:3e:78:cb:25

ip_address='42.51.77.2', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

我们将要删除42.51.77.16这个IP的端口 [root@controller ~]# openstack port delete 1f65a5a9-fb48-4d5c-af6a-0b34a30f85fa

删除后查看虚拟机的IP已经不在了

[root@controller ~]# openstack server list

ID

Name

Status

Networks

Image

Flavor

748a2e6d-083b-4965-a616-170d1a2bc0d4

Ke'Hu-5

ACTIVE

public=42.51.77.21; private=10.0.0.26

基础型

1fef3e0d-c640-4164-b868-6b9dbcdcc7df

Ke'Hu-1

ACTIVE

public=42.51.77.20; private=10.0.0.17

基础型

3b7120d9-579b-4910-9301-6e6364656e53

Ke'Hu-3

ACTIVE

public=42.51.77.15; private=10.0.0.20

基础型

7b383073-5f0c-43ab-8991-421eb2bac3e8

Ke'Hu-4

ACTIVE

public=42.51.77.4; private=10.0.0.9

基础型

b4500423-62fc-455e-b0f5-13fa4c4f5d58

Ke'Hu-2

ACTIVE

public=42.51.77.12; private=10.0.0.10

基础型

439fa0e0-c747-42e5-9abd-80c8e1e20776

ROLY-7

ACTIVE

public=42.51.77.19; private=10.0.0.11

基础型

8a425d87-f53a-4a37-9365-b98daae062bb

ROLY-9

ACTIVE

public=42.51.77.18; private=10.0.0.38

基础型

0a6a2d71-38d0-4a30-8f36-92886dcf980c

ROLY-5

ACTIVE

public=42.51.77.3; private=10.0.0.16

基础型

b8095ceb-005c-4ca8-88be-dbdd7bec39ac

wocaoname

ERROR

基础型

查看端口列表发现IP也不在了

[root@controller ~]# openstack port list

ID

Name

MAC Address

Fixed IP Addresses

Status

0e59952e-8ece-4bb3-8f9e-48b1c790fe16

fa:16:3e:46:9a:80

ip_address='10.0.0.2', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

19136274-b455-4598-b264-5c928aaf73c4

fa:16:3e:2f:8b:aa

ip_address='42.51.77.11', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

1a17b738-9179-4972-8836-53b90d1750e0

fa:16:3e:c4:7e:79

ip_address='42.51.77.15', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

24ea5e26-95e6-4c9e-bd24-42335359a7c8

fa:16:3e:c9:2a:16

ip_address='42.51.77.3', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

2ededcbd-6e3c-4f97-89dc-404dae75aa0c

fa:16:3e:6e:ac:fa

ip_address='42.51.77.12', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

3bae352b-916e-43b3-a8c6-80ce801ce1a3

fa:16:3e:c6:17:07

ip_address='42.51.77.18', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

404d6133-0cce-4f07-aa27-04c90a6d0e37

fa:16:3e:e1:66:1c

ip_address='10.0.0.1', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

55892657-87a4-4631-8b10-c8fbe9d74987

fa:16:3e:a9:f3:c2

ip_address='10.0.0.20', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

6e293e06-83eb-452c-aa54-9deedc2888f4

fa:16:3e:69:fc:9d

ip_address='42.51.77.4', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

7f4cdfe7-401c-40ac-864d-b23500950544

fa:16:3e:99:ef:af

ip_address='10.0.0.38', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

8e6588ae-abf5-40fa-a49d-3545949173e2

fa:16:3e:1e:1e:e2

ip_address='10.0.0.10', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

97431fa6-6f8c-4df2-b90d-032b509f906f

fa:16:3e:01:49:1e

ip_address='42.51.77.21', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

98d141e0-3d0d-4d41-a896-39d0132dd631

fa:16:3e:d2:0d:47

ip_address='10.0.0.17', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

af97265b-9dc5-482e-a4fc-dd705912f4b6

fa:16:3e:6d:64:68

ip_address='42.51.77.20', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

b1090b7b-b9ed-497b-9cb4-e8b03bb4c0f2

fa:16:3e:a4:c0:8e

ip_address='10.0.0.26', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

d3d93d07-7bb5-49a3-af9c-c2d705091686

fa:16:3e:7b:74:fd

ip_address='42.51.77.19', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

d7e7d03d-55bc-4567-893b-5df19b6de78b

fa:16:3e:cc:54:a9

ip_address='10.0.0.16', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

f65e5232-ca19-4a09-b9ff-df100295c060

fa:16:3e:9a:4f:b5

ip_address='10.0.0.9', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

fe60dd7c-0edf-4fb9-a444-3e857f6e8268

fa:16:3e:9c:41:77

ip_address='10.0.0.11', subnet_id='2e2086da-6acb-499e-a22e-a3906bcf48e7'

ACTIVE

ff7fffec-c66a-4b06-bfad-90a932a12a4b

fa:16:3e:78:cb:25

ip_address='42.51.77.2', subnet_id='e97beba0-d8ae-4bc6-9497-abad9200cb60'

ACTIVE

0 人点赞