EVE-NG: Committing / Saving Qemu Virtual Machine Settings

KB ID 0001695

Problem

I’ve been working on a load balancing lab in EVE-NG this last week or so. I created some web servers (in TinyCore Linux,) to act as the web servers in that lab. (Essentially they serve a different colour web page so I can test the load balancing is working OK).

Now I wanted to save the changes I made so that I could redeploy the configured servers to multiple labs. But when you deploy a qemu VM as a node in a lab, EVE-NG copies the VM to the lab, and the changes you make, only apply to the node, in the lab, in the pod, you are working on!

So I wanted to update the ‘Master‘ image in EVE-NG, with the one I configured. Here is how to do that;

Solution

Firstly you need to get your POD NUMBER, you can get that from the user management screen, below you can see my user, (you can see already logged on), is using pod number 1.

EVE-NG Pod Number

Now you need to get the LAB ID NUMBER. Open the lab > Shut down the machine that you want to save the changes from > Lab Details > Copy the lab ID number.

EVE-NG Lab Details

Lastly you need the NODE ID NUMBER. Either  select Nodes and take note of the number, or right click the node and the node ID is shown (in brackets).

EVE-NG Node Number

Armed with those three pieces of information, SSH into the EVE-NG host, and execute the following commands;

cd /opt/unetlab/tmp/POD-NUMBER/LAB-ID/NODE-ID/

for example;

cd /opt/unetlab/tmp/1/2277307f-b0bc-45a4-831f-a89a716b5841/3/

Now depending on the VM/Appliance in question, it may be called hda.qcow2, or virtioa.qcow2 (a quick ls command will tell you!) Take the name and commit the changes with the following command;

/opt/qemu/bin/qemu-img commit hda.qcow2

EVE-NG Commit VM Changes

Job done!

Yes but you wanted three different servers? Correct, I then copied the server (twice) edited the IP address, and the web page served on the two copies and committed the changes back to the original VMs!

Related Articles, References, Credits, or External Links

NA

Author: PeteLong

Share This Post On

2 Comments

  1. After making all the changes on your F5, did you have to shut it down before running the commit command? The video on EVE-NG’s site which showed a Win PC was shutdown first. I actually tried both (shutdown & leave running then commit) but I couldn’t get it to work. Basically, I’m trying to setup my tools on a Linux server image so that everything’s there every time I create a lab. Unfortunately, I’m still stuck at finding out what’s going wrong.

    Post a Reply
    • I’d did shut down the VM yes.

      Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *