Added kvm scripts

This commit is contained in:
Ubuntu
2019-05-15 05:25:39 +00:00
parent 430b8c4a6f
commit 70b5594def
3 changed files with 61 additions and 0 deletions

8
kvm/bulk Normal file
View File

@@ -0,0 +1,8 @@
name=$1
count=$2
start=$3
for i in $(seq $start $count)
do
virt-install -r 8192 --vcpus=8 --pxe --os-type=linux --bridge br0 --bridge br1 --boot=network,hd --disk size=64 --name=$name-$i&
done

7
kvm/bulkrm Normal file
View File

@@ -0,0 +1,7 @@
filter=$1
for vm in $(virsh list --all --name|grep $filter)
do
virsh destroy $vm
virsh undefine $vm --remove-all-storage
done

46
kvm/lxc-profile Normal file
View File

@@ -0,0 +1,46 @@
### This is a yaml representation of the profile.
### Any line starting with a '# will be ignored.
###
### A profile consists of a set of configuration items followed by a set of
### devices.
###
### An example would look like:
### name: onenic
### config:
### raw.lxc: lxc.aa_profile=unconfined
### devices:
### eth0:
### nictype: bridged
### parent: lxdbr0
### type: nic
###
### Note that the name is shown but cannot be changed
config:
boot.autostart: "true"
linux.kernel_modules: ip_tables,ip6_tables,netlink_diag,nf_nat,overlay
raw.lxc: |
lxc.apparmor.profile=unconfined
lxc.mount.auto=proc:rw sys:rw
lxc.cap.drop=
security.nesting: "true"
security.privileged: "true"
description: ""
devices:
aadisable:
path: /sys/module/nf_conntrack/parameters/hashsize
source: /dev/null
type: disk
aadisable1:
path: /sys/module/apparmor/parameters/enabled
source: /dev/null
type: disk
eth0:
nictype: bridged
parent: br0
type: nic
root:
path: /
pool: default
type: disk
name: default