OpenStack命令将卷添加到虚拟机上

2020-06-15 06:16:31 浏览数 (1)

首先加载权限 [root@controller ~]# . admin-openrc

查看虚拟机列表

[root@controller ~]# nova list

ID

Name

Status

Task State

Power State

Networks

1fef3e0d-c640-4164-b868-6b9dbcdcc7df

Ke'Hu-1

ACTIVE

-

Running

public=42.51.77.20; private=10.0.0.17

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

Ke'Hu-2

ACTIVE

-

Running

public=42.51.77.12; private=10.0.0.10

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

Ke'Hu-3

ACTIVE

-

Running

public=42.51.77.15; private=10.0.0.20

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

Ke'Hu-4

ACTIVE

-

Running

public=42.51.77.4; private=10.0.0.9

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

Ke'Hu-5

ACTIVE

-

Running

public=42.51.77.21; private=10.0.0.26

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

ROLY-3

ACTIVE

-

Running

public=42.51.77.16; private=10.0.0.3

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

ROLY-5

ACTIVE

-

Running

public=42.51.77.3; private=10.0.0.16

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

ROLY-7

ACTIVE

-

Running

public=42.51.77.19; private=10.0.0.11

8a425d87-f53a-4a37-9365-b98daae062bb

ROLY-9

ACTIVE

-

Running

public=42.51.77.18; private=10.0.0.38

查看卷列表

[root@controller ~]# openstack volume list

ID

Name

Status

Size

Attached to

2e01aabf-cf58-4a18-b2dd-d21d786ab8d3

in-use

50

Attached to Ke'Hu-5 on /dev/vda

4b03f7dc-a599-4b74-8448-747e7c8ec2b2

in-use

50

Attached to Ke'Hu-4 on /dev/vda

2bcc85bb-f7a1-4359-9fa0-5e5fe7e5d5b0

in-use

50

Attached to Ke'Hu-3 on /dev/vda

8d0650cf-77c6-409a-94fe-bfd2d4379270

in-use

50

Attached to Ke'Hu-2 on /dev/vda

71ced72c-9fb9-411b-b530-4a18215a9e04

in-use

50

Attached to Ke'Hu-1 on /dev/vda

ed916812-9629-438a-ae76-7f4353003015

in-use

50

Attached to ROLY-9 on /dev/vda

1b7aeb9e-0b97-45a4-88a0-253be421c436

available

50

b16fdf1e-5602-49a2-887c-e3fb5c82d9a9

available

50

7a837265-57f5-445d-98a7-e1591fae94f5

in-use

50

Attached to ROLY-7 on /dev/vda

b5aedaf6-058d-4c42-a4f3-5b766e923787

available

50

29defce9-8a72-4fcf-9085-716625b81acf

in-use

50

Attached to ROLY-5 on /dev/vda

40b7b2e8-6fce-46c3-b953-40f86d833098

available

50

b249368c-1321-4745-8b58-d5308f590a6c

in-use

50

Attached to ROLY-3 on /dev/vda

56d6865d-332a-4eef-8f6f-75ecca92b23f

available

50

fac6c8ac-ea4a-4084-b029-cfb54baba634

available

50

6b586b8d-3461-4d85-bcb4-deb951b8d2ce

available

50

db8cb311-d5c7-4300-8542-2caf5038b513

available

50

60eb5cda-fcb3-4913-b530-a90f8b924393

available

50

ad979140-f141-421c-9a1c-b4154600434f

available

50

d40e0d65-4e03-4b4e-907d-7100600ba1d1

available

50

8243344e-a32a-482d-b336-2bc86087944a

available

50

374e625c-b4dd-40ed-b048-da50651f795d

available

50

9c484900-f72e-4ee8-b44a-0889913f4c8e

available

50

1661af42-7cd0-4746-988e-6691ffa14d86

available

50

将可用卷增加到虚拟机上

[root@controller ~]# nova volume-attach ROLY-3 1b7aeb9e-0b97-45a4-88a0-253be421c436

Property

Value

device

/dev/vdc

id

1b7aeb9e-0b97-45a4-88a0-253be421c436

serverId

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

volumeId

1b7aeb9e-0b97-45a4-88a0-253be421c436

0 人点赞