add metadata files
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
b108d836ff
commit
bf00263bc5
9 changed files with 206 additions and 5 deletions
62
README.md
62
README.md
|
|
@ -68,4 +68,66 @@ exec ip netns exec "$NETNS" \
|
|||
--no-resolv \
|
||||
--log-facility="/var/log/dnsmasq-$arg.log" \
|
||||
--no-daemon -p0
|
||||
```
|
||||
|
||||
```
|
||||
vm-1-toto:~# cat /etc/cloud/cloud.cfg.d/20_user.cfg
|
||||
system_info:
|
||||
default_user:
|
||||
name: syonad
|
||||
vm-1-toto:~# cat /etc/cloud/cloud.cfg.d/99_metadata.cfg
|
||||
datasource_list: [ NoCloud ]
|
||||
datasource:
|
||||
NoCloud:
|
||||
seedfrom: 'http://169.254.169.254:80'
|
||||
timeout: 5
|
||||
max_wait: 10
|
||||
```
|
||||
|
||||
|
||||
```
|
||||
qemu-system-x86_64 -enable-kvm -cpu host -m 512 \
|
||||
-smp 1 -serial unix:/tmp/i-0343234.sock,server,nowait \
|
||||
-monitor unix:/tmp/i-0343234.mon-sock,server,nowait \
|
||||
-qmp unix:/tmp/i-0343234.qmp-sock,server,nowait \
|
||||
-drive file=/disk/vm-1.qcow2,if=virtio \
|
||||
-netdev tap,id=net0,ifname=tap9837026863,script=no,downscript=no -device virtio-net-pci,netdev=net0,mac=00:22:33:00:00:0A \
|
||||
-display none -daemonize
|
||||
```
|
||||
|
||||
|
||||
```
|
||||
qemu-system-x86_64 -enable-kvm -cpu host -m 512 \
|
||||
-smp 1 -serial unix:/tmp/i-0343234.sock,server,nowait \
|
||||
-monitor unix:/tmp/i-0343234.mon-sock,server,nowait \
|
||||
-qmp unix:/tmp/i-0343234.qmp-sock,server,nowait \
|
||||
-drive file=/disk/vm-2.qcow2,if=virtio \
|
||||
-drive file=/disk/tmp.qcow2,if=virtio \
|
||||
-drive file=/disk/root.qcow2,if=virtio \
|
||||
-netdev tap,id=net0,ifname=tap9102959250,script=no,downscript=no -device virtio-net-pci,netdev=net0,mac=00:22:33:00:00:0A \
|
||||
-display none -daemonize \
|
||||
-drive file=./seed/seed.iso,media=cdrom,if=ide
|
||||
```
|
||||
|
||||
add public ip:
|
||||
```
|
||||
brctl addbr br-public
|
||||
brctl stp "br-public" off
|
||||
ip link add "veth-public-ext" type veth peer name "veth-public-int" netns "vpc-00003"
|
||||
ip netns exec "vpc-00003" brctl addbr "br-public"
|
||||
ip netns exec "vpc-00003" brctl stp "br-public" off
|
||||
|
||||
brctl addif "br-public" "veth-public-ext"
|
||||
ip netns exec "vpc-00003" brctl addif "br-public" "veth-public-int"
|
||||
|
||||
|
||||
ip link set up dev "veth-public-ext"
|
||||
ip link set up dev "br-public"
|
||||
ip -n "vpc-00003" link set up dev "veth-public-int"
|
||||
ip -n "vpc-00003" link set up dev "br-public"
|
||||
|
||||
ip link add link eno1 name macvlan0 type macvlan mode bridge
|
||||
|
||||
-A PREROUTING -d 192.168.15.2/32 -j DNAT --to-destination 192.168.20.10
|
||||
-A POSTROUTING -s 192.168.20.10/32 -o br-public -j MASQUERADE
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue