mwiget / vmxdocker

Run Juniper Networks vMX in a Docker Container
Apache License 2.0
45 stars 18 forks source link

Unable to install on Ubuntu 14.04 #2

Open asifhj opened 8 years ago

asifhj commented 8 years ago

Here are the details

abacus@abacus-ThinkPad-T440 ~/vmx/vmxdocker $ pwd /home/abacus/vmx/vmxdocker

abacus@abacus-ThinkPad-T440 ~/vmx/vmxdocker $ sudo docker run --name vmx1 --rm --privileged --net=host -v $PWD:/u:ro --env TAR="vmx-15.1F3.11.tgz" --env CFG="vmx1.cfg" --env CONFIG="vmx1-conf.txt" --env DEV="br0 br0" -i -t marcelwiget/vmx:latest Juniper Networks vMX Docker Container (unsupported prototype) Checking system for hugepages ... ok (2537) Please set env TAR with a URL to download vmx-.tgz: docker run .... --env TAR="" ... or specify a RE/VCP image via --env VCP=<jinstall*.img> You can download the latest release from Juniper Networks at http://www.juniper.net/support/downloads/?p=vmx (Requires authentication)

abacus@abacus-ThinkPad-T440 ~/vmx/vmxdocker $ ll total 1524980 drwxrwxrwx 3 root root 4096 Jan 15 17:50 . drwxr-xr-x 4 abacus abacus 4096 Jan 15 15:13 .. -rwxrwxrwx 1 root root 99 Jan 15 15:13 build.sh -rwxrwxrwx 1 root root 10847 Jan 15 15:13 COPYING -rwxrwxrwx 1 root root 1143 Jan 15 15:13 Dockerfile drwxrwxrwx 8 root root 4096 Jan 15 15:13 .git -rwxrwxrwx 1 root root 16941 Jan 15 17:50 launch.sh -rwxrwxrwx 1 root root 10734 Jan 15 15:13 README.md -rwxrwxrwx 1 root root 267 Jan 15 15:13 run-vmx1.sh -rwxrwxrwx 1 root root 263 Jan 15 15:13 run-vmx2.sh -rwxrwxrwx 1 root root 1561459359 Jan 15 16:21 vmx-15.1F4.15.tgz -rwxrwxrwx 1 root root 240 Jan 15 15:13 vmx1.cfg -rwxrwxrwx 1 root root 1446 Jan 15 15:13 vmx1.conf.txt -rwxrwxrwx 1 root root 548 Jan 15 15:13 vmx2.cfg -rwxrwxrwx 1 root root 22771 Jan 15 15:13 vmx3.png

mwiget commented 8 years ago

the vmx file name doesn't match: In your directory you have vmx-15.1F4.15.tgz, but you run the docker command with --env TAR="vmx-15.1F3.11.tgz" instead of --env TAR="vmx-15.1F4.15.tgz"

asifhj commented 8 years ago

My bad, I have overlooked. Anyways appreciate your quick help.

asifhj commented 8 years ago

mwiget, I have built docker image as per your documentation, how can I launch it ?

mwiget commented 8 years ago

Don't follow. By running the command line you showed on top of this thread, now with the corrected filename, you'll get the vMX with the name vmx1 launched. You should see the RE booting up and finally be able to login. It can take a while, as it will also launch the vPFE.

iget@st:~/test$ cat run-vmx1.sh
#!/bin/bash
docker run --name vmx1 --rm --privileged --net=host \
  -v $PWD:/u:ro \
  --env TAR="vmx-15.1F4.15.tgz" \
  --env CFG="vmx1.cfg" \
  --env CONFIG="vmx1.conf.txt" \
  --env DEV="br0 br0" \
  --env MEM="8000" --env VCPU="7" \
  -i -t marcelwiget/vmx:latest
mwiget@st:~/test$ ./run-vmx1.sh
Juniper Networks vMX Docker Container (unsupported prototype)

Checking system for hugepages ... ok (20000)
CPU supports high performance PFE image
Building virtual interfaces and bridges ...
need to create bridge br0
interface br0 found
br0 is an existing bridge
==================================
BRIDGES:  br0 br0
TAPS:     br0:gee8c80 br0:gee8c81
INTS:
PCIDEVS:
==================================
extracting VM's from vmx-15.1F4.15.tgz ...
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.102423 s, 1.0 GB/s
mkfs.fat 3.0.27 (2014-11-12)
VCP image: /tmp/vmx-15.1F4-3/images/jinstall64-vmx-15.1F4.15-domestic.img
VFP image: /tmp/vmx-15.1F4-3/images/vFPC-20151203.img
hdd image: /tmp/vmx-15.1F4-3/images/vmxhdd.img
METADATA : -usb -usbdevice disk:format=raw:metadata.img -smbios type=0,vendor=Juniper -smbios type=1,manufacturer=Juniper,product=VM-vcp_vmx2-161-re-0,version=0.1.0
waiting for login prompt ...
spawn telnet localhost 8700
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Consoles: serial port
BIOS drive A: is disk0
BIOS drive C: is disk1
BIOS drive D: is disk2
BIOS drive E: is disk3
BIOS 639kB/2046840kB available memory

FreeBSD/i386 bootstrap loader, Revision 1.2
(builder@svl-junos-p001, Wed Dec 23 17:54:33  2015)
Loading /boot/defaults/loader.conf
/kernel text=0x9e5040 data=0x88638+0x1409d8 syms=[0x8+0xf06a8+0x8+0xeecd6]
/boot/modules/if_bge.ko size 0x48b60 at 0x118f000
/boot/modules/if_em.ko size 0x644e0 at 0x11d8000
/boot/modules/mpt_core.ko size 0x57558 at 0x123d000
/boot/modules/if_bce.ko size 0x63328 at 0x1295000
/boot/modules/if_bxe.ko size 0x170d88 at 0x12f9000
/boot/modules/acb.ko size 0x4da70 at 0x146a000
/boot/modules/tcb.ko size 0x20e28 at 0x14b8000
/boot/modules/mcs.ko size 0x19e20 at 0x14d9000
...

Have a look at run-vmx1.sh, which looks very similar to the command you tried. Building your own container instead of automatically downloading a pre-built one from Docker Hub requires you to run

docker build -t marcelwiget/vmx:latest .

(which is the content of build.sh).

asifhj commented 8 years ago

Can I install this on VM, I am not sure whether it will work or not as vMX uses KVM right?

mwiget commented 8 years ago

Don't think it'll work. It really assumes a bare metal underneath the container. After all, qemu-kvm gets launched from within the container for the two VM's within: vRE and vPFE.

asifhj commented 8 years ago

mwiget, have you tried setting up vSRX uding docker ?