LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 12-24-2019, 08:18 AM   #1
red.hive
LQ Newbie
 
Registered: Oct 2012
Posts: 24

Rep: Reputation: Disabled
rhel kvm qcow2 sparse/incremental storage


Hello everyone,

Thank you for having me here.

I have been a user of vmware for a very long time. Now I am trying to switch to KVM, using RHELs virtual machine manager GUI to create the VMs. I have encountered two problems and I was wondering if you could help me.

1 - I can't get it to fit the screen, it stays like a square in the middle. In vmware this is fixed with vmtools. I searched the internet on how to do it for kvm auto fit window but I didn't find anything. Any ideas?

2 - I didn't find a way to set incremental disk size, it pre-allocates all the space and it is not good for me. I want it sparse/incremental, not pre-allocated as I don't have much space. In vmware GUI they give you the choice, in KVM I didn't find a way to do it. Any ideas?

The host is RHEL 8 and the guest will be RHEL 7.7

Many thanks!

red.hive
 
Old 12-24-2019, 09:16 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,657

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by red.hive View Post
Hello everyone,
Thank you for having me here.
You've been here for quite some time now.
Quote:
I have been a user of vmware for a very long time. Now I am trying to switch to KVM, using RHELs virtual machine manager GUI to create the VMs. I have encountered two problems and I was wondering if you could help me.

1 - I can't get it to fit the screen, it stays like a square in the middle. In vmware this is fixed with vmtools. I searched the internet on how to do it for kvm auto fit window but I didn't find anything. Any ideas?
Reading the RHEL 8 documentation on KVM would be a good start, as would reading the "Question Guidelines" link in my posting signature. You don't say how you're viewing this virtual machine (SSH? Directly on the system console? Serial?), or what you've done/tried so far. Have you just tried modifying the screen resolution on the VM as you would on any OTHER 'real' machine???? Have you tried to resize the window? Running virsh and editing the file to increase the video memory and running xrandr to adjust screen size are also things to try.
https://access.redhat.com/documentat...rtual-machines
Quote:
2 - I didn't find a way to set incremental disk size, it pre-allocates all the space and it is not good for me. I want it sparse/incremental, not pre-allocated as I don't have much space. In vmware GUI they give you the choice, in KVM I didn't find a way to do it. Any ideas?
There isn't a way, as far as I know. You have to allocate space for the disk image up front. You can allocate a small slice, and resize it later with virt-resize.
Quote:
The host is RHEL 8 and the guest will be RHEL 7.7
So have you contacted Red Hat support, since you're using RHEL?? If you're not PAYING for RHEL, I'd stop where you are and load CentOS instead. You will be missing ALL the patches/updates/fixes/security fixes that RHEL has put out since introduction of those releases, some of which could very well affect your operation. Since you were getting your 'certification' seven years ago, you should be familiar with RHEL and their business model.
 
Old 12-24-2019, 09:45 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
Quote:
Originally Posted by red.hive View Post
2 - I didn't find a way to set incremental disk size, it pre-allocates all the space and it is not good for me. I want it sparse/incremental, not pre-allocated as I don't have much space. In vmware GUI they give you the choice, in KVM I didn't find a way to do it. Any ideas?
Just how are you creating that disk volume? If you are using virt-manager, it's just a matter of removing the check mark from the box: "Allocate entire disk now". You can also use qemu-img to make a sparse copy of an existing file:
Code:
qemu-img convert -O qcow2 src_filename new_filename
Do not do that while the VM is running! The default is to leave 4KB blocks of all-zeros unallocated in the output. This size can be changed with the "-S sparse_size" option. See the qemu-img manpage for details.

Last edited by rknichols; 12-24-2019 at 09:48 AM.
 
1 members found this post helpful.
Old 12-24-2019, 09:50 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,657

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by rknichols View Post
Just how are you creating that disk volume? If you are using virt-manager, it's just a matter of removing the check mark from the box: "Allocate entire disk now".
Really? I've seen that option but never used it. Assumed it would still 'save' the disk space as part of the image file, just not format it. Have always just allocated what I needed, and resized if necessary.
Quote:
You can also use qemu-img to make a sparse copy of an existing file:
Code:
qemu-img convert -O qcow2 src_filename new_filename
The default is to leave 4KB blocks of all-zeros unallocated in the output. This size can be changed with the "-S sparse_size" option. See the qemu-img manpage for details.
Nice; saving this command.
 
Old 12-24-2019, 10:19 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
Quote:
Originally Posted by rknichols View Post
You can also use qemu-img to make a sparse copy of an existing file:
Code:
qemu-img convert -O qcow2 src_filename new_filename
Do not do that while the VM is running! The default is to leave 4KB blocks of all-zeros unallocated in the output. This size can be changed with the "-S sparse_size" option. See the qemu-img manpage for details.
Quote:
Originally Posted by TB0ne View Post
Nice; saving this command.
You might also look at the manpage for the virt-sparsify command. It first fills the existing filesystem(s) up with zeros (using a snapshot so as not to disturb the original filesystems), then creates the sparse copy with the all-zero blocks unallocated.
 
1 members found this post helpful.
Old 12-24-2019, 11:38 AM   #6
red.hive
LQ Newbie
 
Registered: Oct 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
You've been here for quite some time now.
True, but I haven't been active in a long time due to illness so I thought it would be polite to thank again for having me here.

Thank you for the answer and apologies for not being clear. I am viewing it at a friend's home regular PC, which is the host + one guest VM, just trying to learn a bit about KVM. Yes, the first thing I did was to change the resolution, then click on "fit window" and all the other things one usually does, it didn't help. The square stood the same. The guest is 7.7, the host is 8, so I didn't know where the problem would be. I will try virsh and xrandr, though I don't know these commands very well, I will read about them. Thank you.

There isn't a way, as far as I know. You have to allocate space for the disk image up front. You can allocate a small slice, and resize it later with virt-resize.

I understand, as I said, I am at a friend's house, came here just to learn a bit, re the certification, as I said, I was away for some time due to illness and therefore did not learn farther than my last postings, restarting now. Thank you for your kindness and patience.
 
Old 12-24-2019, 11:43 AM   #7
red.hive
LQ Newbie
 
Registered: Oct 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
Just how are you creating that disk volume? If you are using virt-manager, it's just a matter of removing the check mark from the box: "Allocate entire disk now". You can also use qemu-img to make a sparse copy of an existing file:
Code:
qemu-img convert -O qcow2 src_filename new_filename
Do not do that while the VM is running! The default is to leave 4KB blocks of all-zeros unallocated in the output. This size can be changed with the "-S sparse_size" option. See the qemu-img manpage for details.
Hi, I am using Virtual Machine Manager, but I don't have an option of "allocate entire disk now". I had that in vmware, but in this gui I don't see it. Thank you for your answer regarding the disk - qemu-img convert -O qcow2 src_filename new_filename - I am not sure I understand the where I should run this command, in the host?

I will also learn about virt-sparsify, coming from vmware this is all new. Thank you so much for your kindness!
 
Old 12-24-2019, 01:30 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
Quote:
Originally Posted by red.hive View Post
Hi, I am using Virtual Machine Manager, but I don't have an option of "allocate entire disk now". I had that in vmware, but in this gui I don't see it. Thank you for your answer regarding the disk - qemu-img convert -O qcow2 src_filename new_filename - I am not sure I understand the where I should run this command, in the host?

I will also learn about virt-sparsify, coming from vmware this is all new. Thank you so much for your kindness!
I don't have a suitable RHEL 8 host available to test this, so perhaps that's an option that was for some reason omitted in that version.

Yes, the qemu-img commands, all of them, are run in the host. Most of them require that the associated VM not be running.
 
1 members found this post helpful.
Old 12-24-2019, 02:52 PM   #9
red.hive
LQ Newbie
 
Registered: Oct 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thank you, I will try it out!
 
Old 12-24-2019, 04:31 PM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,657

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by rknichols View Post
I don't have a suitable RHEL 8 host available to test this, so perhaps that's an option that was for some reason omitted in that version.

Yes, the qemu-img commands, all of them, are run in the host. Most of them require that the associated VM not be running.
As said before, if you are not going to PAY for RHEL, then don't use it, and use CentOS instead. There is zero reason to use RHEL without paying, especially if this is for a 'friends' machine, or for testing purposes. You will NOT get bugfixes/patches/updates, and you may very likely encounter problems that have already been fixed, but (without paying and having access to the Red Hat repositories), you will NOT GET.
 
Old 12-25-2019, 08:49 AM   #11
red.hive
LQ Newbie
 
Registered: Oct 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
As said before, if you are not going to PAY for RHEL, then don't use it, and use CentOS instead. There is zero reason to use RHEL without paying, especially if this is for a 'friends' machine, or for testing purposes. You will NOT get bugfixes/patches/updates, and you may very likely encounter problems that have already been fixed, but (without paying and having access to the Red Hat repositories), you will NOT GET.
Hi. Why the quotes in the word friend? Didn't understand that one. So repeating, as I said. I am at a friend's house, he has RHEL because he works for a company that uses RHEL. So his PC and laptop are RHEL. As simple as that. I don't pay for anything. I have CentOS and Ubuntu at home. But I came to him to work on a real RHEL because I thought it would solve those issues I have with KVM because I want to *learn*. It didn't. So I came to the opensource community to see if I can get help, which I did, and for that I thank everyone.
 
Old 12-26-2019, 02:54 PM   #12
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,657

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by red.hive View Post
Hi. Why the quotes in the word friend? Didn't understand that one. So repeating, as I said. I am at a friend's house, he has RHEL because he works for a company that uses RHEL. So his PC and laptop are RHEL. As simple as that. I don't pay for anything.
So your 'friend' pays for it...which means it's 100% up to date, and has all the patches/fixes installed, right?? Which was the whole point of asking if you're paying, since (again), if you're not, you don't have any of those things installed, nor can you even get them. Odd that your 'friend' has RHEL 8 and 7 licenses from his company, since such things are usually standardized on a particular version for ease of administration in the enterprise.
Quote:
I have CentOS and Ubuntu at home. But I came to him to work on a real RHEL because I thought it would solve those issues I have with KVM because I want to *learn*. It didn't. So I came to the opensource community to see if I can get help, which I did, and for that I thank everyone.
If you already use CentOS, you should be aware that it's 99.x% IDENTICAL to RHEL, so using your 'friends' computer didn't get you anything additional...you could have spun up a KVM on CentOS 8, and used CentOS 7.7 as a guest.
 
  


Reply

Tags
incremental, kvm, qcow2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sparse file issue with KVM david888 Linux - Software 7 11-09-2017 08:33 AM
Compressed Column Storage Sparse Matrix: Adding an element ejspeiro Programming 12 06-29-2012 04:34 PM
Converting Xen RAW image to KVM qcow2 makes Win2k8 guest BSOD Savaan Linux - Virtualization and Cloud 9 12-31-2011 11:59 AM
kvm-qemu-img: qcow2 disk image format changes to raw format in RHEL-KVM 5.6 rajivdp Linux - Virtualization and Cloud 2 09-19-2011 11:23 AM
How to resize the qcow2 image in the KVM? rajivdp Linux - Virtualization and Cloud 2 03-23-2011 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 03:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration