axsh / wakame-vdc

Datacenter Hypervisor - Open Source Cloud Computing / IaaS
http://wakame-vdc.org
109 stars 28 forks source link

hva/kvm: `run.sh` does not provide reproducable command set. #533

Closed hansode closed 9 years ago

hansode commented 9 years ago

Problem

sample run.sh:

$ strings i-wlvi41fl/run.sh
#!/bin/bash
/usr/libexec/qemu-kvm -m 256 -smp 1 -name vdc-i-wlvi41fl -pidfile /var/lib/wakame-vdc/instances/i-wlvi41fl/kvm.pid -daemonize -monitor telnet:127.0.0.1:32529,server,nowait -no-kvm-pit-reinjection -vnc 127.0.0.1:25635 -serial telnet:127.0.0.1:29025,server,nowait -drive file=/var/lib/wakame-vdc/instances/i-wlvi41fl/vol-lkupzqac,id=vol-lkupzqac-drive,if=none,serial=vol-lkupzqac,cache=none,aio=native -device virtio-blk-pci,id=vol-lkupzqac,drive=vol-lkupzqac-drive,bootindex=0,bus=pci.0,addr=0x4 -drive file=/var/lib/wakame-vdc/instances/i-wlvi41fl/metadata.img,id=metadata-drive,if=none,serial=metadata,cache=none,aio=native -device virtio-blk-pci,id=metadata,drive=metadata-drive,bus=pci.0,addr=0x5 -drive file=/var/lib/wakame-vdc/instances/i-wlvi41fl/vol-pazyj3b6,id=vol-pazyj3b6-drive,if=none,serial=vol-pazyj3b6,cache=none,aio=native -device virtio-blk-pci,id=vol-pazyj3b6,drive=vol-pazyj3b6-drive,bus=pci.0,addr=0x6 -net nic,vlan=0,macaddr=52:54:00:76:cd:e5,model=virtio,addr=10 -net tap,vlan=0,ifname=vif-x2ttqaxb,script=no,downscript=no
/sbin/ip link set vif-x2ttqaxb up/usr/sbin/brctl addif br0 vif-x2ttqaxb

it should be like following.

/sbin/ip link set vif-x2ttqaxb up
/usr/sbin/brctl addif br0 vif-x2ttqaxb

Possible solution

fixing 2 lines: https://github.com/axsh/wakame-vdc/blob/master/dcmgr%2Flib%2Fdcmgr%2Fdrivers%2Fhypervisor%2Flinux_hypervisor%2Fkvm.rb#L213-L214

            run_sh += ("/sbin/ip link set %s up" % [vif_uuid(vif)])
            run_sh += (attach_vif_cmd)
  • add \n to that lines.
Metallion commented 9 years ago

Merged. https://github.com/axsh/wakame-vdc/pull/555