当前位置: 首页 > news >正文

pve 命令开启关闭虚拟机

  1. 命令
    #查看集群资源状况
    #pvesh get /cluster/resources

#取得虚拟机当前状态

#pvesh get /nodes/<节点id>/qemu/<虚拟机id>/status/current
#pvesh get /nodes/www/qemu/107/status/current#关闭虚拟机
#pvesh create /nodes/<节点id>/qemu/<虚拟机id>/status/stop
#pvesh create /nodes/www/qemu/107/status/stop#启动虚拟机
#pvesh create /nodes/<节点id>/qemu/<虚拟机id>/status/start
#pvesh create /nodes/www/qemu/107/status/start

原文链接:https://blog.csdn.net/hlz_07/article/details/121983208

  1. 实例
root@pve:/hdd-st4000/ssd500G-bak# pvesh get /cluster/resources
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| id                           | type    | cgroup-mode | content                                   |   cpu |       disk | hastate | level | maxcpu |    maxdisk |     maxm
+==============================+=========+=============+===========================================+=======+============+=========+=======+========+============+=========
| lxc/102                      | lxc     |             |                                           | 0.00% |     0.00 B |         |       |      1 |   8.00 GiB | 512.00 M
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| lxc/103                      | lxc     |             |                                           | 0.00% |     0.00 B |         |       |      1 |   8.00 GiB | 512.00 M
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| lxc/104                      | lxc     |             |                                           | 0.00% |     0.00 B |         |       |      1 |   8.00 GiB | 512.00 M
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| node/pve                     | node    |           2 |                                           | 1.10% |   8.82 GiB |         |       |      2 |  11.62 GiB |  22.32 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| node/pve2                    | node    |           2 |                                           | 3.77% |  12.46 GiB |         |       |      4 |  24.10 GiB |   7.54 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/100                     | qemu    |             |                                           | 0.00% |     0.00 B |         |       |      2 |  32.00 GiB |   7.91 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/101                     | qemu    |             |                                           | 0.00% |     0.00 B |         |       |      1 |  32.00 GiB |   2.00 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/105                     | qemu    |             |                                           | 6.20% |     0.00 B |         |       |      2 |  32.00 GiB |   4.00 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/106                     | qemu    |             |                                           | 0.00% |     0.00 B |         |       |      2 |  50.00 GiB |   4.00 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/107                     | qemu    |             |                                           | 0.20% |     0.00 B |         |       |      2 |  32.00 GiB |   4.00 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/108                     | qemu    |             |                                           | 0.00% |     0.00 B |         |       |      2 |  32.00 GiB |   8.00 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/109                     | qemu    |             |                                           | 0.00% |     0.00 B |         |       |      2 |  32.00 GiB |   4.00 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/110                     | qemu    |             |                                           | 0.00% |     0.00 B |         |       |      2 |  32.00 GiB |   4.00 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/111                     | qemu    |             |                                           | 0.00% |     0.00 B |         |       |      2 |  66.00 GiB |   4.00 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/112                     | qemu    |             |                                           | 0.25% |     0.00 B |         |       |      2 |  32.00 GiB |   4.00 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| qemu/113                     | qemu    |             |                                           | 0.35% |     0.00 B |         |       |      2 |  32.00 GiB |   4.00 G
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| sdn/pve/localnetwork         | sdn     |             |                                           |       |            |         |       |        |            |
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| sdn/pve2/localnetwork        | sdn     |             |                                           |       |            |         |       |        |            |
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| storage/pve/pve.11-lib-vz    | storage |             | vztmpl,snippets,backup,rootdir,iso,images |       | 361.52 GiB |         |       |        |   3.51 TiB |
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| storage/pve/temp_500G_ssd    | storage |             | images,iso,rootdir,backup,snippets,vztmpl |       | 217.32 GiB |         |       |        | 468.38 GiB |
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| storage/pve2/pve.11-lib-vz   | storage |             | vztmpl,snippets,backup,rootdir,iso,images |       |  12.46 GiB |         |       |        |  24.10 GiB |
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| storage/pve2/pve2-intel-16G  | storage |             | backup,vztmpl,snippets,images,rootdir,iso |       |   4.51 GiB |         |       |        |  12.59 GiB |
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
| storage/pve2/pve2-intel-256G | storage |             | backup,vztmpl,snippets,images,rootdir,iso |       |  25.47 GiB |         |       |        | 215.12 GiB |
+------------------------------+---------+-------------+-------------------------------------------+-------+------------+---------+-------+--------+------------+---------
root@pve:/hdd-st4000/ssd500G-bak# pvesh get /nodes/pve/qemu/110/status/current
+-----------+--------------------+
| key       | value              |
+===========+====================+
| cpus      | 2                  |
+-----------+--------------------+
| ha        | {"managed":0}      |
+-----------+--------------------+
| maxdisk   | 32.00 GiB          |
+-----------+--------------------+
| maxmem    | 4.00 GiB           |
+-----------+--------------------+
| name      | debian12-k8s-node3 |
+-----------+--------------------+
| qmpstatus | stopped            |
+-----------+--------------------+
| status    | stopped            |
+-----------+--------------------+
| uptime    | 0s                 |
+-----------+--------------------+
| vmid      | 110                |
+-----------+--------------------+
root@pve:/hdd-st4000/ssd500G-bak# pvesh create /nodes/pve/qemu/110/status/start
UPID:pve:00015E11:002CE92B:66F3B9DB:qmstart:110:root@pam:
root@pve:/hdd-st4000/ssd500G-bak# pvesh get /nodes/pve/qemu/110/status/current
+-----------------+--------------------+
| key             | value              |
+=================+====================+
| cpus            | 2                  |
+-----------------+--------------------+
| ha              | {"managed":0}      |
+-----------------+--------------------+
| maxdisk         | 32.00 GiB          |
+-----------------+--------------------+
| maxmem          | 4.00 GiB           |
+-----------------+--------------------+
| name            | debian12-k8s-node3 |
+-----------------+--------------------+
| pid             | 89631              |
+-----------------+--------------------+
| qmpstatus       | running            |
+-----------------+--------------------+
| running-machine | pc-q35-8.1+pve0    |
+-----------------+--------------------+
| running-qemu    | 8.1.5              |
+-----------------+--------------------+
| status          | running            |
+-----------------+--------------------+
| uptime          | 6s                 |
+-----------------+--------------------+
| vmid            | 110                |
+-----------------+--------------------+
root@pve:/hdd-st4000/ssd500G-bak# pvesh create /nodes/pve/qemu/110/status/stop
UPID:pve:00015E98:002CF15F:66F3B9F0:qmstop:110:root@pam:
root@pve:/hdd-st4000/ssd500G-bak# pvesh get /nodes/pve/qemu/110/status/current
+-----------+--------------------+
| key       | value              |
+===========+====================+
| cpus      | 2                  |
+-----------+--------------------+
| ha        | {"managed":0}      |
+-----------+--------------------+
| maxdisk   | 32.00 GiB          |
+-----------+--------------------+
| maxmem    | 4.00 GiB           |
+-----------+--------------------+
| name      | debian12-k8s-node3 |
+-----------+--------------------+
| qmpstatus | stopped            |
+-----------+--------------------+
| status    | stopped            |
+-----------+--------------------+
| uptime    | 0s                 |
+-----------+--------------------+
| vmid      | 110                |
+-----------+--------------------+
http://www.lryc.cn/news/447610.html

相关文章:

  • 【达梦数据库】临时表的使用测试
  • 【GUI设计】基于Matlab的图像去噪GUI系统(8),matlab实现
  • 【计算机科学导论】
  • 【C++】I/O流的使用介绍
  • 深度学习:(八)深层神经网络参数与流程
  • `pattern = r“(\d+)(CNY|JPY|HKD|EUR|GBP|fen|cents|sen|eurocents|pence)“
  • 宝塔面板部署雷池社区版教程
  • 【击败100%】258. 各位相加
  • 【alist】宝塔面板docker里的alist默认admin无法登录
  • 【击败100%】1281. 整数的各位积和之差
  • Flink基本概念和算子使用
  • Kafka 3.0.0集群部署教程
  • 昇思MindSpore进阶教程-格式转换
  • 搜索软件 Everything 的安装与使用教程
  • oracle 如何判断当前时间在27号到当月月底
  • Django 配置邮箱服务,实现发送信息到指定邮箱
  • Git使用手册
  • sql-labs靶场
  • 【Redis入门到精通二】Redis核心数据类型(String,Hash)详解
  • 如何快速免费搭建自己的Docker私有镜像源来解决Docker无法拉取镜像的问题(搭建私有镜像源解决群晖Docker获取注册表失败的问题)
  • QT 获取视频帧Opencv获取清晰度
  • 生成式AI如何辅助医药行业智能营销
  • 演示:基于WPF的DrawingVisual开发的Chart图表和表格绘制
  • 汽车保养BBBBBBBBBBB
  • H3C R4900 G3服务器上配置本地磁盘RAID
  • HBase DDL操作代码汇总(namespace+table CRUD操作)
  • 关于TCP的基础知识
  • MyBatis 中的类型别名配置详解
  • 如何提高UI自动化的稳定性
  • ubuntu如何开启和关闭图形界面