-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxmox_multi
45 lines (40 loc) · 1.51 KB
/
proxmox_multi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#demands:
1.batch create
1.1 create ct template
1.1.1 web create ct
1.1.2 shutdown ct create template
1.2 batch create ct
1.2.1 line clone
for VMID in {105..110}; do pct clone 101 $VMID ; done;
1.2.2 full clone
for VMID in {105..110}; do pct clone 101 $VMID --full; done;
-------------------------------or-------------------------------
1.1 create template(like docker) #to be solved
1.2 batch create ct #to be solved
pct create
1.3 batch start
pct start 110
1.3 install services(like openssh*) #to be solved
1.4 get ip
pct exec 102 ip addr show|grep global|sed 's#/24##g'|awk '{print$2}'
2.remote access
2.1 ssh ip/web access(vnc)
3.batch delete
pct destroy id --purge
for VMID in {111..112}; do pct destroy $VMID --purge --force; done;
commands:
for VMID in {105..110}; do pct clone 101 $VMID ; done; #批量创建ct主机(复制模板)-链接复制
for VMID in {105..110}; do pct clone 101 $VMID --full; done; #批量复制模板-链接复制
pct list #列出当前ct主机、状态、主机名
pct start 110 #启动110ct主机
pct status 102 #查看102主机状态
pct exec 105 pwd #在105主机执行命令
pct destroy 110 --purge #彻底清除ct主机
1.web create ct
2.shutdown ct create template
3.batch create ct
for VMID in {105..110}; do pct clone 101 $VMID ; done;
4.batch start
for VMID in {105..110}; do pct start $VMID ; done;
5.batch delete
for VMID in {111..112}; do pct destroy $VMID --purge --force; done;