Details

    Description

      Hi.

       

      The attached tarball contains a vm control script that works like a netif.tmpl:

      • create a symlink to /etc/init.d/vmctl.tmpl with desired vm name:
      cd /etc/init.d && ln -s vmctl.tmpl vm.web
      • create a conf file /etc/conf.d/vm.web:
      template=qemu
      qemu_arch=x86_64
      qemu_net="macvtap web0 model=virtio-net-pci
      tap web1 model=virtio-net-pci"
      qemu_opts="-machine type=q35,accel=kvm
      -daemonize
      -cpu host
      -smp 1
      -m 1G
      -drive file=/var/vm/tmpl.img,format=raw,if=virtio,index=0"
      • create confs for web0 and web1:
        cat /etc/conf.d/net.web0:
      template=macvtap
      mac_replace=52:54:00:01:01:01
      base=net.eth0
      mode=bridge

      cat /etc/conf.d/net.web1:

      template=tap
      bridge="net.brwebnas"

      cat /etc/conf.d/net.brwebnas:

      template=bridge
      • now we can start/stop/etc this vm

      Attachments

        1. README
          0.5 kB
        2. vmctl.txz
          3 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lego12239 lego12239
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: