How to eliminate The Multiple Guest.IMGs in the \GOLD\<ImageName> Directory (GUEST.IMG, GUEST-2.IMG, GUEST-3.IMG..etc.) and Retain the Modification(s).

How to eliminate The Multiple Guest.IMGs in the \GOLD\<ImageName> Directory (GUEST.IMG, GUEST-2.IMG, GUEST-3.IMG..etc.) and Retain the Modification(s).

Product Line:  VERDE

Statement From a Customer:

I have seen that each time I perform a check-out and check-in, in the Gold Image storage folder a new file is created:

GUEST-2.IMG 
GUEST-3.IMG 
GUEST.IMG


What is this about?  And how can I eliminate such huge files?

Engineer Response:

that is a function of the newer qcow2 format. Each one is dependent on the previous version.

There is the base file, then the next, etc. No more GOW format.

Here is how to apply the modifications and delete the additional GUEST.IMG images.

****NOTE**** Do not perform this activity if your Gold Image has a Cloned Image***
‚Äč
Ensure all Virtual Images associated with the Gold Image are shutdown and the Gold Image is Checked IN.
Go to the subject Gold Image's home directory as in my example:
/home/vb-verde/verde-orgs/org-0/gold/Win764bit/

List the contents
[root@localhost Win764bit]# ls -la
total 9739192
drwxr-xr-x 2 vb-verde vb-verde       4096 Aug 29 17:32 .
drwxr-xr-x 3 vb-verde vb-verde       4096 Aug 29 16:21 ..
-rw-r--r-- 1 vb-verde vb-verde  102301696 Aug 29 17:26 GUEST-2.IMG
-rw-r--r-- 1 vb-verde vb-verde  176947200 Aug 29 17:32 GUEST-3.IMG
-rw-r--r-- 1 vb-verde vb-verde 9693691904 Aug 29 17:09 GUEST.IMG
-rw-r--r-- 1 vb-verde vb-verde       8596 Aug 29 16:12 installwin4.log
-rw-r--r-- 1 vb-verde vb-verde       2986 Aug 29 16:12 log.smbd.txt
-rw-r--r-- 1 vb-verde vb-verde         47 Aug 29 16:12 macaddr
-rw-r--r-- 1 vb-verde vb-verde      13070 Aug 29 16:12 screenshot.jpg
-rw-r--r-- 1 vb-verde vb-verde        178 Aug 29 17:32 .session-info
-rw-r--r-- 1 vb-verde vb-verde        372 Aug 29 16:21 settings.local
-rw-r--r-- 1 vb-verde vb-verde         74 Aug 29 16:21 settings.local.policy
-rw-r--r-- 1 vb-verde vb-verde        431 Aug 29 16:12 settings.local.pre_import
-rw-r--r-- 1 vb-verde vb-verde         62 Aug 29 16:12 .ticket
-rw-r--r-- 1 vb-verde vb-verde         60 Aug 29 17:32 vb.gold
-rw-r--r-- 1 vb-verde vb-verde        120 Aug 29 16:12 vb.last_boot
-rw-r--r-- 1 vb-verde vb-verde     104199 Aug 29 16:12 win4.txt
-rw-r--r-- 1 vb-verde vb-verde      44477 Aug 29 16:12 win4.txt.prev 

We are concerned with applying the modifications in GUEST-2.IMG and GUEST-3.IMG to the main file GUEST.IMG and delete #2 and #3.
We will start with the oldest  GUEST-2.IMG.  From this directory, type the following:

/usr/lib/verde/bin/qemu-img rebase -b GUEST.IMG GUEST-2.IMG

This will take a few minutes.  Then run the following command.  Once again it will take a while:

/usr/lib/verde/bin/qemu-img commit GUEST-2.IMG

Now do the same for GUEST-3.IMG:

/usr/lib/verde/bin/qemu-img rebase -b GUEST.IMG GUEST-3.IMG
/usr/lib/verde/bin/qemu-img commit GUEST-3.IMG

The modifications have been applied.  Now we have to tell VERDE that the real image is GUEST.IMG.  We need to edit the file vb.gold.
This is what it looks like before modifying:

 
This is how it should be modified.  Set back to the first version and the size of the first GUEST.IMG


Now you can delete the extra GUEST.IMG files:

[root@localhost Win764bit]# rm -f GUEST-2.IMG
[root@localhost Win764bit]# rm -f GUEST-3.IMG

This is the result and you should be ready to use your image again!

[root@localhost Win764bit]# ls -la
total 9490784
drwxr-xr-x 2 vb-verde vb-verde       4096 Aug 29 17:47 .
drwxr-xr-x 3 vb-verde vb-verde       4096 Aug 29 16:21 ..
-rw-r--r-- 1 vb-verde vb-verde 9718333440 Aug 29 17:44 GUEST.IMG
-rw-r--r-- 1 vb-verde vb-verde       8596 Aug 29 16:12 installwin4.log
-rw-r--r-- 1 vb-verde vb-verde       2986 Aug 29 16:12 log.smbd.txt
-rw-r--r-- 1 vb-verde vb-verde         47 Aug 29 16:12 macaddr
-rw-r--r-- 1 vb-verde vb-verde      13070 Aug 29 16:12 screenshot.jpg
-rw-r--r-- 1 vb-verde vb-verde        178 Aug 29 17:32 .session-info
-rw-r--r-- 1 vb-verde vb-verde        372 Aug 29 16:21 settings.local
-rw-r--r-- 1 vb-verde vb-verde         74 Aug 29 16:21 settings.local.policy
-rw-r--r-- 1 vb-verde vb-verde        431 Aug 29 16:12 settings.local.pre_import
-rw-r--r-- 1 vb-verde vb-verde         62 Aug 29 16:12 .ticket
-rw-r--r-- 1 vb-verde vb-verde         40 Aug 29 17:47 vb.gold
-rw-r--r-- 1 vb-verde vb-verde        120 Aug 29 16:12 vb.last_boot
-rw-r--r-- 1 vb-verde vb-verde     104199 Aug 29 16:12 win4.txt
-rw-r--r-- 1 vb-verde vb-verde      44477 Aug 29 16:12 win4.txt.prev



    • Related Articles

    • Clean, Easy Method of Combining All the GUEST-#.IMG Image Layer Files Back Into The One GUEST.IMG File

      Product Line:  VERDE Statement From a Customer: I have seen that each time I perform a check-out and check-in, in the Gold Image storage folder a new file is created: GUEST-2.IMG  GUEST-3.IMG  GUEST.IMG What is this about?  And how can I eliminate ...
    • Instructions for Enlarging the Gold Image (GUEST.IMG)

      Product Line:  VERDE It's common place for a customer to need to expand the size of the Gold Image or a Clone.  Here are simple instructions: Back up the Gold Image’s entire Directory (just in case). If the target gold image has an associated Clone, ...
    • Things You Should Not Do When Creating A Gold Image

      Project Type: VERDE There are three mandatory settings (SessionSettings) when creating a new Gold Image.  These three settings should remain in the Default SessionSetting so that every image gets the correct settings.  The three are:  Networking ...
    • Multiple Fully Functional DNS/Domain Servers

      Product Lline:  VERDE It's a rare request that a customer has a security need to have separate, fully functioning multiple DNS/Domain servers.  In order to support this request/requirement, there are no changes to VERDE.  The only change is to the ...
    • FAQ: VERDE 8.2 Frequently Asked Questions.

      VERDE 8.2 FAQs:   What’s new in VERDE 8.2? VERDE 8.2 is our latest VERDE-VDI offering and has been upgraded to use the latest Red Hat / CentOS QEMU-KVM modules for increased performance and hardware emulation capabilities.  This means that we are now ...