KVM - new image from ISO - networking at install

Hi,

I’ve got a working environment up and running with a KVM host using OpenVSwitch. For images deployed from the Marketplace, I can assign them the network that gives them address space directly on the attached LAN and I can connect / ping / SSH etc. So far so good.

What I’m trying to do now is take an ISO and generate my own images. I’ve been using this as a guide: http://www.whotouchedmygun.com/2014/03/17/create-a-vm-image-in-opennebula/

Basically - upload the ISO (I’m using Ubuntu mini 14.04) , create an empty hard disk, create a template with both of those - boot the ISO and then start the installation process to disk. Everything works up until it attempts to contact the ubuntu archive where it fails.

Checking the networking, I find I’m unable to get any ping response - but I can see that a port is created on the host. Opennebula shows that a network address has been assigned.

Has anyone else had issues with networking when installing from ISO media? This may be less of an OpenNebula issue and more of a Ubuntu / KVM / OpenvSwitch problem.

I’m going to try creating the image externally and then try and import it in rather than do the install directly on the host.

Cloud9 forum@opennebula.org writes:

Hi,

Hello,

[…]

Basically - upload the ISO (I’m using Ubuntu mini 14.04) , create an
empty hard disk, create a template with both of those - boot the ISO
and then start the installation process to disk. Everything works up
until it attempts to contact the ubuntu archive where it fails.

Checking the networking, I find I’m unable to get any ping response -
but I can see that a port is created on the host. Opennebula shows
that a network address has been assigned.

Has anyone else had issues with networking when installing from ISO
media? This may be less of an OpenNebula issue and more of a Ubuntu /
KVM / OpenvSwitch problem.

At my work, we are doing ISO install near every week to check our Ubuntu
derivative install process.

We are using KVM with OpenVswitch.

The only point is that the ISO is not contextualized, so the network
address assigned by OpenNebula is not automatically configured.

We need to configure the network manually or with DHCP during the
install process.

On tty2 during the install process, you can have a shell to check ip
parameters, you should check at least:

  • Do you have an IP:

    ip addr show
    
  • Do you have a default gateway:

    ip route show
    
  • Can you reach the gateway:

    ping @IP_GATEWAY
    
  • Do you have DNS resolution:

    ping archive.ubuntu.com
    

Regards.

Daniel Dehennin
Récupérer ma clef GPG: gpg --recv-keys 0xCC1E9E5B7A6FE2DF
Fingerprint: 3E69 014E 5C23 50E8 9ED6 2AAD CC1E 9E5B 7A6F E2DF
signature.asc (342 Bytes)

1 Like

I really appreciate that feedback. I think that should point me in the right direction and it explains perfectly why a straight ISO install results in this issue.

Thanks again for your time.

I had another look at this and I have a DHCP server on the network that I’m attaching to. However, the virtual network defined in OpenNebula also had a range defined and was applying that IP when starting up the VM. Naturally, as pointed out, this fails because of lack of contextualisation. The mix of the two ends up meaning that the VM fails to get network connectivity.

I fixed it by creating a dedicated startup network with a fixed mac address and a lease of a single fixed IP. On the DHCP server, I mapped that same mac address to the same IP as defined in the startup network in OpenNebula. Once both the DHCP server and OpenNebula were in agreement about the address, I got external network connectivity.

Now I can download the Ubuntu contextualisation package, install it and then turn the thing in to an image.

I’m sure there are better ways of doing this but still, at least it’s working.