RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1732998 - virt-sparsify --key option is not working
Summary: virt-sparsify --key option is not working
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.7
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-25 00:06 UTC by Jawad Rajput
Modified: 2019-07-25 15:58 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-25 15:58:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jawad Rajput 2019-07-25 00:06:11 UTC
We have a virtual machine guest running on CentOS-7 KVM that is taking more disk space than the pre-allocated space, guest was made through Virt-Manager. Now, there is almost no space left on the hypervisor. Guest has 12TB encrypted /opt partition but actual use is 1 TB. Hypervisor had 14TB which now used by the guest qcow2 image. Both hypervisor and guest are CentOS-7. Guest currently has no snapshot either.   
   
I recently come across virt-sparsify tool, but when using "virt-sparsify --in-place some.qcow2 --key" it is not asking for key. I am hoping if someone can tell me the right syntax.

Tried all the following options given in the help, but none of them worked, and keep getting syntax error. There is not much information online about virt-sparsify key option.  

    --key /opt:key:"encryption password"

    --key /opt:file:enc_pass_file

Comment 2 YongkuiGuo 2019-07-25 02:54:53 UTC
There is no '--key' option for virt-sparsify command. You can use '--echo-keys' or '--keys-from-stdin' option instead. Please see the man page.

Comment 3 Pino Toscano 2019-07-25 08:21:28 UTC
(In reply to YongkuiGuo from comment #2)
> There is no '--key' option for virt-sparsify command. You can use
> '--echo-keys' or '--keys-from-stdin' option instead. Please see the man page.

It is a new option in libguestfs 1.40.0, in virt-sparsify and other OCaml tools.
Which version of libguestfs are you using? What is the OS where you are using it?

(In reply to Jawad Rajput from comment #0)
> Tried all the following options given in the help, but none of them worked,
> and keep getting syntax error. There is not much information online about
> virt-sparsify key option.

http://libguestfs.org/virt-sparsify.1.html describes it.

>     --key /opt:key:"encryption password"
> 
>     --key /opt:file:enc_pass_file

The first part of the selector for --key is the encrypted device.

Comment 4 Jawad Rajput 2019-07-25 15:46:03 UTC
Thanks Pino for the response. The OS is CentOS Linux release 7.6.1810 (Core)  and libguestfs is 1.38.2. 

# uname -r
3.10.0-957.21.3.el7.x86_64

# rpm -qa libguestfs
libguestfs-1.38.2-12.el7_6.2.x86_64

Comment 5 Jawad Rajput 2019-07-25 15:46:42 UTC
(In reply to YongkuiGuo from comment #2)
> There is no '--key' option for virt-sparsify command. You can use
> '--echo-keys' or '--keys-from-stdin' option instead. Please see the man page.

Thanks Yong, I will give it a try.

Comment 6 Pino Toscano 2019-07-25 15:58:08 UTC
(In reply to Jawad Rajput from comment #4)
> Thanks Pino for the response. The OS is CentOS Linux release 7.6.1810 (Core)
> and libguestfs is 1.38.2. 

virt-sparsify in this version does not have --key.
The version that will be in RHEL 7.7 (and thus CentOS 7.7) will have it.


Note You need to log in before you can comment on or make changes to this bug.