OpenStack命令挂起-恢复虚拟机

2020-06-13 12:48:09 浏览数 (1)

命令:nova suspend NAME-或者-ID

首先查看虚拟机名字或者ID

[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

通过ID进行将虚拟机挂起 [root@controller ~]# nova suspend b8095ceb-005c-4ca8-88be-dbdd7bec39ac

我们查看到虚拟机已经是挂起状态

[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

SUSPENDED

-

Shutdown

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

我们通过虚拟机名字进行恢复---也可以是ID-----名字和ID都可以使用 [root@controller ~]# nova resume ROLY-3

我们再次查看虚拟机状态已经恢复

[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

0 人点赞