My first OpenNebula appliance in the Marketplace

I’m very happy to announce that today I’ve uploaded my first appliance to OpenNebula’s Marketplace. For my first appliance I’ve choosen Vyatta Core’s virtual router/firewall.

It was difficult to make the contextualization work but it helped me to learn more about OpenNebula and Vyatta. Please leave your comments or contact me if you find any problem with this image.

Thanks to Vyatta’s forum and other blogs I could understand how I could configure automatically the interface addresses. I want to share with you many links that were helpful:

I’d also like to thank C12G for Marketplace and my friend Jose David for hosting the image.

I hope this image works for you and that you find it useful.

Enjoy!

Advertisements

9 thoughts on “My first OpenNebula appliance in the Marketplace

  1. Chris says:

    Hello,

    I love this application in OpenNebula. I do have a couple of questions and it is probably just me not understanding OpenNebula completely. I have a /29 assigned to the OpenNebula server but when I build the public template and launch vyatta it gives me a /24 instead I attempted the context from opennebula but no luck. I also have another question I got NAT to work going from the inside out but coming from the outside back in via port forwarding its unsuccessful. Here is my nat rules

    vyatta eth0: 1.1.1.2/29
    vyatta eth1: 192.168.1.1/24
    vyatta@one-vc65r1# show nat
    destination {
    rule 10 {
    destination {
    address 1.1.1.3
    port ssh
    }
    inbound-interface eth0
    protocol tcp
    translation {
    address 192.168.1.2
    }
    }
    }
    source {
    rule 10 {
    outbound-interface eth0
    source {
    address 10.158.0.0/24
    }
    translation {
    address 1.1.1.2
    }
    }
    }

    Like

    • n40lab says:

      Hi Cris,
      first of all thank you for your comment I’ll try to do my best to answer your questions.

      About /24 mask. OpenNebula uses contextualization to assign automatically one address from the virtual network pool to the network interface. One of the methods to assign the network address is using a script. I modified OpenNebula’s original script but it also used a /24 mask. The script works like this: the last four octets of the mask address are the four octets for an IPv4 address but the script uses a /24 mask address by default so maybe that’s why that mask is used instead of your /29 mask. The script that runs the contextualization is stored in: /opt/vyatta/sbin/vyatta-vmcontext.sh and if you open that script you’ll see this line: $WRAPPER set interfaces ethernet $DEV address $IP/24 this is where /24 is forced.

      Ok that’s the explanation about /24 mask. Now, if you want to solve this problem :-D, the settings of the contextualization script are not persistent unless you use the save command. If you use the save command, please do comment the two lines following “OpenNebula vm contextualization script execution” in the /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script (important: use sudo to change that file) so the contextualization script vmcontext.sh doesn’t break your router’s configuration on boot. If I have misunderstood the problem or this tip doesn´t solve your problem let me know and I’ll try to help.

      About the second question I’m no Vyatta expert but I’ll try to check it your configuration, I’ll answer you in a few minutes.

      Regards,

      Like

      • n40lab says:

        Hi again,
        I think your NAT configuration is correct but did you check if 192.168.1.2 address is set in your eth0 interface as a secondary address?. In my working configuration, if the 192.168.1.91 address is not configured for the eth0 interface my destination NAT doesn’t work, no arp is answered so no traffic is sent to the router.

        vyatta@one-router:~$ show interfaces
        Interface IP Address S/L Description
        ——— ———- — ———–
        eth0 192.168.1.90/24 u/u
        192.168.1.91/24

        vyatta@one-router# show nat
        destination {
        rule 50 {
        destination {
        address 192.168.1.91
        port http
        }
        inbound-interface eth0
        protocol tcp
        translation {
        address 192.168.40.2
        }
        }
        }

        I hope this helps.

        Regards,

        Miguel

        Like

  2. Chris says:

    Yes this worked. Seems you have to attach the external ip address to your external interface on the Vyatta. Then it works.

    Thank You,
    Chris

    Like

  3. Chris says:

    I do have another question. Kind of off-topic. But I am having an issue regarding CD-ROM’s within Nebula. Wondering if maybe you found a “fix” or something I am missing. I can install the O/S with no issue but when it reboots it loads the CD. I attempted to detach the CDROM from sunstone or through cli but no success. I receive an error. I tried to setup each disk with a TARGET but still nothing. I also tried to do onevm poweroff to change the deployment.0 file to stop booting from CDROM but nothing. Wondering if you had some insight on this. Here is my template.

    CPU=”0.5″
    DISK=[
    DRIVER=”raw”,
    FORMAT=”raw”,
    SIZE=”20480″,
    TYPE=”fs” ]
    DISK=[
    DRIVER=”raw”,
    IMAGE=”CentOS 6.4 64bit CD”,
    IMAGE_UNAME=”oneadmin”,
    GRAPHICS=[
    LISTEN=”0.0.0.0″,
    TYPE=”vnc” ]
    INPUT=[
    BUS=”usb”,
    TYPE=”mouse” ]
    MEMORY=”1024″
    NAME=”CentOS 64bit (Small)”
    NIC=[
    IP=”10.158.0.200″,
    NETWORK=”Private”,
    NETWORK_UNAME=”oneadmin” ]
    OS=[
    ARCH=”x86_64″,
    BOOT=”cdrom” ]
    RAW=[
    TYPE=”kvm” ]
    TEMPLATE_ID=”34″
    VCPU=”4″

    Like

    • n40lab says:

      Hi again!
      in your template you have a line BOOT=”cdrom” I think that’s why your machine is always booting from CD.

      I would change that line with BOOT=”hd” and then I would instantiate a new machine using that template and your vm will start from your CentOS disk, that’s what I usually do.

      If that doesn’t solve your issue let me know and we’ll find a solution together.

      Regards,

      Miguel

      Like

  4. Chris says:

    Well I attempted placing the “boot string with hd instead which still boots to the CD-ROM. I noticed the cdrom is attached hda and the hard drive attached hdb. I attempted to force the template to attach the hard drive to hda and the cd-rom either hdb or vda but no luck still boots the cdrom. I attempted to detach but got a weird error from qemu within the oned.log

    Like

    • n40lab says:

      Hi Chris,
      sorry being late but I have limited Internet access these days and I have my laboratory down for maintenance as I want to be ready for OpenNebula 4.0, I could send you a sample vm template on Sunday. Anyway, keeping the BOOT=”hd”, you could try to remove from your template the DISK section for the CD image:

      DISK=[
      DRIVER=”raw”,
      IMAGE=”CentOS 6.4 64bit CD”,
      IMAGE_UNAME=”oneadmin”,

      Also is there a typo in the template? a square bracket should be expected before the graphics section.

      Regards

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s