查看集群下的节点信息

root@pve63-node172:~# pvecm nodes

Membership information
----------------------
Nodeid Votes Name
1 1 pve63-node172 (local)
2 1 pve63-node173
3 1 pve63-node174

查看集群状态

root@pve63-node172:~# pvecm status
Cluster information
-------------------
Name: cluster01
Config Version: 3
Transport: knet
Secure auth: on

Quorum information
------------------
Date: Wed Aug 18 10:52:44 2021
Quorum provider: corosync_votequorum
Nodes: 3
Node ID: 0x00000001
Ring ID: 1.ef8
Quorate: Yes

Votequorum information
----------------------
Expected votes: 3
Highest expected: 3
Total votes: 3
Quorum: 2
Flags: Quorate

Membership information
----------------------
Nodeid Votes Name
0x00000001 1 10.38.1.172 (local)
0x00000002 1 10.38.1.173
0x00000003 1 10.38.1.174
root@pve63-node172:~# pveperf
CPU BOGOMIPS: 12767.98
REGEX/SECOND: 3122567
HD SIZE: 29.16 GB (/dev/mapper/pve-root)
BUFFERED READS: 22.83 MB/sec
AVERAGE SEEK TIME: 38.18 ms
FSYNCS/SECOND: 19.76
DNS EXT: 61.32 ms
DNS INT: 233.43 ms (test.com)
root@pve63-node172:~#
-----------------------------------

qm 虚拟机相关操作命令

1、查看虚拟机列表

root@pve63-node172:~# qm list
VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID
104 Copy-of-VM-debian10-ci stopped 512 2.00 0
107 CT201 running 512 32.00 278817
108 VM 108 stopped 2048 1.00 0
109 v111 running 1024 0.00 1368522
110 v112 running 1024 2.00 159297
111 centOS7 stopped 512 10.00 0
113 v113 stopped 1024 2.00 0
114 v123 stopped 1024 2.00 0
116 v112 stopped 1024 2.00 0
132 debian10 stopped 1024 12.00 0
201 CT201 stopped 512 32.00 0
502 debian10-ci stopped 512 2.00 0
902 VM 902 stopped 4096 3.00 0
root@pve63-node172:~#

2、其他命令

USAGE: qm <COMMAND> [ARGS] [OPTIONS]

qm cloudinit dump <vmid> <type>

qm guest cmd <vmid> <command>
qm guest exec-status <vmid> <pid>
qm guest passwd <vmid> <username> [OPTIONS]
qm guest exec <vmid> [<extra-args>] [OPTIONS]

qm clone <vmid> <newid> [OPTIONS]
qm config <vmid> [OPTIONS]
qm create <vmid> [OPTIONS]
qm delsnapshot <vmid> <snapname> [OPTIONS]
qm destroy <vmid> [OPTIONS]
qm list [OPTIONS]
qm listsnapshot <vmid>
qm migrate <vmid> <target> [OPTIONS]
qm move_disk <vmid> <disk> <storage> [OPTIONS]
qm pending <vmid>
qm reboot <vmid> [OPTIONS]
qm reset <vmid> [OPTIONS]
qm resize <vmid> <disk> <size> [OPTIONS]
qm resume <vmid> [OPTIONS]
qm rollback <vmid> <snapname>
qm sendkey <vmid> <key> [OPTIONS]
qm set <vmid> [OPTIONS]
qm shutdown <vmid> [OPTIONS]
qm snapshot <vmid> <snapname> [OPTIONS]
qm start <vmid> [OPTIONS]
qm stop <vmid> [OPTIONS]
qm suspend <vmid> [OPTIONS]
qm template <vmid> [OPTIONS]
qm unlink <vmid> --idlist <string> [OPTIONS]

qm cleanup <vmid> <clean-shutdown> <guest-requested>
qm importdisk <vmid> <source> <storage> [OPTIONS]
qm importovf <vmid> <manifest> <storage> [OPTIONS]
qm monitor <vmid>
qm mtunnel
qm nbdstop <vmid>
qm rescan [OPTIONS]
qm showcmd <vmid> [OPTIONS]
qm status <vmid> [OPTIONS]
qm terminal <vmid> [OPTIONS]
qm unlock <vmid>
qm vncproxy <vmid>
qm wait <vmid> [OPTIONS]

网络命令

1、查看防火墙

# pve-firewall compile
ipset cmdlist:

iptables cmdlist:

ip6tables cmdlist:

ebtables cmdlist:
ignore FORWARD (2jmj7l5rSw0yVb/vlWAYkK/YBwk)
ignore INPUT (2jmj7l5rSw0yVb/vlWAYkK/YBwk)
ignore OUTPUT (2jmj7l5rSw0yVb/vlWAYkK/YBwk)

iptables table raw cmdlist:

ip6tables table raw cmdlist:
no changes
firewall disabled

2、打印出本地网络相关信息

~# pve-firewall localnet
local hostname: pve63-node172
local IP address: 10.38.1.172
network auto detect: 10.38.1.0/24
using detected local_network: 10.38.1.0/24

accepting corosync traffic from/to:
- pve63-node173: 10.38.1.173 (link: 0)
- pve63-node174: 10.38.1.174 (link: 0)

3、重启防火墙

pve-firewall restart

4、启动防火墙

pve-firewall start

5、停止防火墙

pve-firewall stop