This commit is contained in:
spiritlhl
2023-12-31 09:29:18 +00:00
parent c4fa94de79
commit 3051eb7e2e
4 changed files with 72 additions and 44 deletions

View File

@@ -125,7 +125,7 @@ Below is the information for the example VM that has been set up:
| Host Storage Disk | local |
| IPV6 address | N |
### Deletion Examples
## Deletion specific VM
- Stop VM
- Delete VM
@@ -133,19 +133,22 @@ Below is the information for the example VM that has been set up:
- Restart network
- Delete log files
**Download Script**
```shell
qm stop 102
qm destroy 102
iptables -t nat -F
iptables -t filter -F
service networking restart
systemctl restart networking.service
systemctl restart ndpresponder.service
iptables-save | awk '{if($1=="COMMIT"){delete x}}$1=="-A"?!x[$0]++:1' | iptables-restore
iptables-save > /etc/iptables/rules.v4
rm -rf vm102
curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/pve_delete.sh -o pve_delete.sh && chmod +x pve_delete.sh
```
**Meaning of each parameter**
You can delete the VM with the corresponding VMID, as demonstrated here using the example 102 above
```shell
./pve_delete.sh 102
```
The actual number of deletions is not fixed, a space separates each VMID, and more than one can be deleted at a time.
## Batch Creation of Virtual Machines with KVM Virtualization and NAT
:::warning

View File

@@ -80,7 +80,7 @@ Please note that "CT" and other technical terms might have specific meanings in
| Host Storage Disk | local |
| IPV6 address | N |
### Deletion Examples
## Deletion specific CT
- Stop CT
- Delete CT
@@ -88,19 +88,22 @@ Please note that "CT" and other technical terms might have specific meanings in
- Restart Network
- Delete Log Files
**Download Script**
```shell
pct stop 102
pct destroy 102
rm -rf ct102
iptables -t nat -F
iptables -t filter -F
service networking restart
systemctl restart networking.service
systemctl restart ndpresponder.service
iptables-save | awk '{if($1=="COMMIT"){delete x}}$1=="-A"?!x[$0]++:1' | iptables-restore
iptables-save > /etc/iptables/rules.v4
curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/pve_delete.sh -o pve_delete.sh && chmod +x pve_delete.sh
```
**Meaning of each parameter**
You can delete the CT with the corresponding CTID, as demonstrated here using the example 102 above
```shell
./pve_delete.sh 102
```
The actual number of deletions is not fixed, a space separates each CTID, and more than one can be deleted at a time.
## Batch Creation of LXC Containers with NAT
:::warning

View File

@@ -142,7 +142,7 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/p
| 宿主机的存储盘 | local |
| 绑定独立IPV6(留空默认N) | N |
### 删除示例
## 删除指定虚拟机
- 停止VM
- 删除VM
@@ -150,19 +150,30 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/p
- 重启网络
- 删除log文件
**下载脚本**
国际
```shell
qm stop 102
qm destroy 102
iptables -t nat -F
iptables -t filter -F
service networking restart
systemctl restart networking.service
systemctl restart ndpresponder.service
iptables-save | awk '{if($1=="COMMIT"){delete x}}$1=="-A"?!x[$0]++:1' | iptables-restore
iptables-save > /etc/iptables/rules.v4
rm -rf vm102
curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/pve_delete.sh -o pve_delete.sh && chmod +x pve_delete.sh
```
国内
```shell
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/pve_delete.sh -o pve_delete.sh && chmod +x pve_delete.sh
```
**使用方法**
可以删除对应VMID的虚拟机这里用上文中的示例102做演示
```shell
./pve_delete.sh 102
```
实际删除数量不固定空格分隔每个VMID即可可一次性删除多个
## 批量开设NAT的KVM虚拟化的虚拟机
:::warning

View File

@@ -86,7 +86,7 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/p
| 宿主机的存储盘 | local |
| IPV6 | 无 |
### 删除示例
## 删除指定容器
- 停止CT
- 删除CT
@@ -94,19 +94,30 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/p
- 重启网络
- 删除log文件
**下载脚本**
国际
```shell
pct stop 102
pct destroy 102
rm -rf ct102
iptables -t nat -F
iptables -t filter -F
service networking restart
systemctl restart networking.service
systemctl restart ndpresponder.service
iptables-save | awk '{if($1=="COMMIT"){delete x}}$1=="-A"?!x[$0]++:1' | iptables-restore
iptables-save > /etc/iptables/rules.v4
curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/pve_delete.sh -o pve_delete.sh && chmod +x pve_delete.sh
```
国内
```shell
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/pve_delete.sh -o pve_delete.sh && chmod +x pve_delete.sh
```
**使用方法**
可以删除对应CTID的容器这里用上文中的示例102做演示
```shell
./pve_delete.sh 102
```
实际删除数量不固定空格分隔每个CTID即可可一次性删除多个
## 批量开设NAT的LXC虚拟化的CT
:::warning