From 033d03fa2b7801221da1808c78ed241a4420aa11 Mon Sep 17 00:00:00 2001 From: zwb <1465302821@qq.com> Date: Thu, 26 Dec 2024 10:18:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20MD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MD/KVM批量管理脚本.txt | 271 +++++++++++++++++++++++++++++++++++++++++ MD/O.sh | 71 +++++++++++ MD/P.sh | 30 +++++ MD/xtrabackup.sh | 41 +++++++ MD/zhuwenbao.sh | 63 ++++++++++ 5 files changed, 476 insertions(+) create mode 100644 MD/KVM批量管理脚本.txt create mode 100644 MD/O.sh create mode 100644 MD/P.sh create mode 100644 MD/xtrabackup.sh create mode 100644 MD/zhuwenbao.sh diff --git a/MD/KVM批量管理脚本.txt b/MD/KVM批量管理脚本.txt new file mode 100644 index 0000000..e8c6ab5 --- /dev/null +++ b/MD/KVM批量管理脚本.txt @@ -0,0 +1,271 @@ +#!/usr/bin/bash +list(){ + echo "|--------------------------------|" + echo "|---------批量管理工具箱-----------|" + echo "|----1.创建自定义配置单个虚拟机------|" + echo "|----2.批量创建自定义配置虚拟机------|" + echo "|----3.批量创建默认配置虚拟机--------|" + echo "|----4.删除虚拟机------------------|" + echo "|----5.退出-----------------------|" +} +dgchuangjian(){ + read -p "请输入你的虚拟机名字" vm_name + read -p "请输入内存大小(MB)" memory + read -p "请输入cpu核数" vcpus + read -p "请输入磁盘大小(G): " disk_size + kvmuuid=`uuidgen` + #kvmmac=`openssl rand -hex 3| sed -r 's/..\B/&:/g'` + virsh define <( + + cat < + $vm_name + $kvmuuid + + + + + + $(($memory * 1024)) + 2048000 + $vcpus + + hvm + + + + + + + + + + + + + destroy + restart + destroy + + + + + + /usr/libexec/qemu-kvm + + + + +
+ + + + + +
+ + +
+ + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + +
+ + +
+ + + + + +
+ + + + + + + + + + + +
+ + +
+ + + + + + +