LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Missing images in virt-manager GUI display (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/missing-images-in-virt-manager-gui-display-4175590036/)

fanoflq 09-23-2016 01:27 PM

Missing images in virt-manager GUI display
 
I want to backup and made extra copies of KVM images.
And thought if I want to transfer a KVM image to another
distribution, I just have to copy it into virt-manager's image folder.
and run it via virt-manager again.

I made a copy of a VM image like so:

NOTE: There are some copies that were deleted using virt-manager, but still shows up in the listing below. WHY?

Quote:

/var/lib/libvirt/images $ sudo cp centos7-1024ram-minimal.qcow2 centos7-1024ram-minimal-clone1.qcow2

/var/lib/libvirt/images $ sudo ls -al
total 18268668
drwx--x--x 2 root root 4096 Sep 23 11:59 .
drwxr-xr-x 7 root root 4096 Sep 22 11:03 ..
-rw------- 1 root root 12887130112 Sep 19 18:25 centos7-1024ram-dvd-1.qcow2
-rw------- 1 root root 12887130112 Sep 19 18:20 centos7-1024ram-dvd.qcow2
-rw------- 1 root root 15034941440 Sep 23 12:00 centos7-1024ram-minimal-clone1.qcow2
-rw------- 1 root root 15034941440 Sep 21 21:29 centos7-1024ram-minimal.qcow2
-rw------- 1 root root 12887130112 Sep 19 17:50 centos7-1024RAM.qcow2
-rw------- 1 root root 5306253312 Sep 20 15:46 centos7-1500ram-iso-clone1.qcow2
-rw------- 1 root root 5306253312 Sep 21 09:19 centos7-1500ram-iso-clone2.qcow2
-rw------- 1 root root 15034941440 Sep 20 15:22 centos7-1500ram-iso.qcow2


But my manually copied image (centos7-1500ram-iso-clone1.qcow2) does not show up in virt-manager!

Likewise, some images in above listing did not show up in virt-manager app.

I closed and restart virt-manager mutiple times.
Same missing images occurs.

The images that were installed or cloned by virt-manager shows up.
Those I deleted using virt-manager disappeared from virt-manager's GUI, but seems to still exists in /var/lib/libvirt/images. WHY?

If I am not able to see those copied images, then I cannot start or reconfigure a (K)VM image using virt-manager, obviously ....

So how do I make virt-manager display manually copied (cloned) images
in its /var/lib/libvirt/images directory?

Thank you.

gradinaruvasile 09-24-2016 02:54 AM

Maybe click on the Refresh "Volume List" button?

fanoflq 09-24-2016 06:41 AM

@gradinaruvasile:

Where is Refresh "Volume List" in virt-manager?

end 09-24-2016 07:30 PM

re
 
try

virsh --connect qemu:///system list

and open again virt manager or

virsh --connect qemu:///system start .img

and open manager again

gradinaruvasile 09-24-2016 08:49 PM

1 Attachment(s)
Quote:

Originally Posted by fanoflq (Post 5609477)
@gradinaruvasile:

Where is Refresh "Volume List" in virt-manager?

See the attachment.

fanoflq 09-24-2016 09:17 PM

@gradinaruvasile:

Your screenshot, it is virt-manager?
My virt-manager do not have those types of GUI.
It looks like this:
https://www.virt-manager.org/wp-cont...er-vm-list.png

I am using Linuxx Mint 18.

What OS is your host?
What is the name of your app?

gradinaruvasile 09-25-2016 01:09 AM

It's virt-manager 1.4.0 on Debian Testing. The screen i shown is when you click edit->connection details->storage tab.

fanoflq 09-25-2016 07:35 AM

@end:

Tried all your methods.
None of them seems to work.

Quote:

/var/lib/libvirt/images $ virsh --connect qemu:///system list
Id Name State
----------------------------------------------------

/var/lib/libvirt/images $ virsh --connect qemu:///system start .img
error: failed to get domain '.img'
error: Domain not found: no domain with matching name '.img'

end 09-25-2016 08:01 AM

replace .img with your centos7-1500ram-iso-clone1.qcow2 or any other

virsh --connect qemu:///system start virsh centos7-1500ram-iso-clone1.qcow2

or try coppy with this command cp -adpR centos7-1500ram-iso-clone1.qcow2

i follow

http://techlinux.net/2014/09/kvm-centos-7/

http://www.charleslabri.com/installi...7-x64-and-kvm/

fanoflq 09-25-2016 08:02 AM

@gradinaruvasile:

i did this:

Quote:

sudo cp centos7-1500ram-iso.qcow2 centos7-1500ram-iso-clone3.qcow2
When I refresh the storage tab, it shows up.
BUT it did not show up in the app's main display area like this:
https://www.virt-manager.org/wp-cont...er-vm-list.png

Then I tried to run it:
Quote:

virt-viewer --connect qemu:///system centos7-1500ram-iso-clone3
It returns error: "Cannot find guest domain centos7-1500ram-iso-clone3"

So it seems I may have to use virt-clone utility like so for it to show up in virt-manager:

Quote:

/var/lib/libvirt/images $ sudo virt-clone --original centos7-1500ram-iso --auto-clone
Allocating 'centos7-1500ram-iso-clone.qcow2' | 14 GB 00:02:27

Clone 'centos7-1500ram-iso-clone' created successfully.

gradinaruvasile 09-25-2016 01:04 PM

Well. You should RTM.A qcow2 file is JUST a virtual hdd imge. It is NOT a virtual machine definition file. Ergo, copying it will NOT create a new virtual machine.

The libvirt vm definition files are in xml format here (this is for Debian, i suppose these are the same for all distros):

Code:

/etc/libvirt/qemu/{vmname}.xml
All vms that are running under libvirt have a .xml file here.

fanoflq 09-25-2016 09:32 PM

@gradinaruvasile:

Need elaboration:
Quote:

You should RTM. A qcow2 file is JUST a virtual hdd imge.
What is RTM?

So the only way to clone is to use virt-clone or virt-manager.

gradinaruvasile 09-26-2016 03:09 AM

Quote:

Originally Posted by fanoflq (Post 5610008)
@gradinaruvasile:
So the only way to clone is to use virt-clone or virt-manager.

That's the way of doing it, yes. You can copy the xml files too but you will have to modify them (change UUIDs/MACs/whatever) and restart the libvirt service.

Quote:

Originally Posted by fanoflq (Post 5610008)
What is RTM?

It's Read The Manual

PS
I wanted to be sarcastic here, but it seems googling RTM might not be as straightforward as i thought for someone not familiar with the term. Also, although wikipedia is the first on the hit list it also provides a long list of meanings - still under the section "Technology and Internet" the first link is "Read the manual" (which redirects to RTFM ...)


All times are GMT -5. The time now is 01:22 PM.