forked from uncloud/uncloud
add hack scripts
This commit is contained in:
parent
cf4930ee84
commit
ebcb1680d7
4 changed files with 79 additions and 0 deletions
2
uncloud/hack/hackcloud/foo
Normal file
2
uncloud/hack/hackcloud/foo
Normal file
|
@ -0,0 +1,2 @@
|
|||
tap0
|
||||
tap0
|
8
uncloud/hack/hackcloud/ifup.sh
Executable file
8
uncloud/hack/hackcloud/ifup.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo $@ >> foo
|
||||
|
||||
dev=$1; shift
|
||||
|
||||
# bridge is setup from outside
|
||||
ip link set dev "$dev" master ${bridge}
|
21
uncloud/hack/hackcloud/net.sh
Executable file
21
uncloud/hack/hackcloud/net.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
netid=100
|
||||
dev=wlp2s0
|
||||
dev=wlp0s20f3
|
||||
dev=wlan0
|
||||
|
||||
vxlandev=vxlan${netid}
|
||||
bridgedev=br${netid}
|
||||
|
||||
ip -6 link add ${vxlandev} type vxlan \
|
||||
id ${netid} \
|
||||
dstport 4789 \
|
||||
group ff05::${netid} \
|
||||
dev ${dev} \
|
||||
ttl 5
|
||||
|
||||
ip link set ${vxlandev} up
|
||||
|
||||
ip link add ${bridgedev} type bridge
|
||||
ip link set ${bridgedev} up
|
48
uncloud/hack/hackcloud/vm.sh
Executable file
48
uncloud/hack/hackcloud/vm.sh
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
|
||||
vmid=$1; shift
|
||||
|
||||
qemu=/usr/bin/qemu-system-x86_64
|
||||
|
||||
accel=kvm
|
||||
accel=tcg
|
||||
|
||||
memory=1024
|
||||
cores=2
|
||||
uuid=732e08c7-84f8-4d43-9571-263db4f80080
|
||||
|
||||
export bridge=br100
|
||||
|
||||
$qemu -name uc${vmid} \
|
||||
-machine pc,accel=${accel} \
|
||||
-m ${memory} \
|
||||
-smp ${cores} \
|
||||
-uuid ${uuid} \
|
||||
-drive file=alpine-virt-3.11.2-x86_64.iso,media=cdrom \
|
||||
-netdev tap,id=netmain,script=./ifup.sh \
|
||||
-device virtio-net-pci,netdev=netmain,id=net0,mac=02:00:f0:a9:c4:4e
|
||||
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
-S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-17-one-24992/master-key.aes
|
||||
-machine pc-i440fx-2.8,accel=kvm,usb=off,dump-guest-core=off
|
||||
|
||||
-m 2048
|
||||
-realtime mlock=off
|
||||
-smp 1,sockets=1,cores=1,threads=1
|
||||
-uuid 732e08c7-84f8-4d43-9571-263db4f80080 -no-user-config \
|
||||
-nodefaults
|
||||
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-17-one-24992/monitor.sock,server,nowait
|
||||
-mon chardev=charmonitor,id=monitor,mode=control
|
||||
-rtc base=utc -no-shutdown
|
||||
-boot strict=on
|
||||
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
|
||||
-drive file=rbd:ssd/one-292-24992-0:id=libvirt:auth_supported=cephx\;none:mon_host=ceph1\:6789\;ceph2\:6789\;ceph3\:6789,format=raw,if=none,id=drive-virtio-disk0,cache=none
|
||||
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
|
||||
-drive file=/var/lib/one//datastores/104/24992/disk.1,format=raw,if=none,id=drive-ide0-0-0,readonly=on
|
||||
-device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0
|
||||
-netdev tap,fd=36,id=hostnet0,vhost=on,vhostfd=38
|
||||
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=02:00:f0:a9:c4:4e,bus=pci.0,addr=0x3
|
||||
-vnc [::]:4414 -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on
|
Loading…
Reference in a new issue