virt-v2v-inspector - Estimate disk space needed before virt-v2v conversion


 virt-v2v-inspector [-i* options] guest


Virt-v2v-inspector is a companion tool for virt-v2v(1) which can be used before conversion to estimate the number of output disks and disk space that will be required to complete the virt-v2v conversion. The common use for this is to preallocate target disks on management systems that need this (like Kubevirt).

This manual page only documents the estimation feature, not all of the -i* options which are the same as virt-v2v. You should read virt-v2v(1) first.

Selecting the input guest

You can run virt-v2v-inspector with the same -i* options as virt-v2v. (Don't use any -o* options). This will select the guest that you want to estimate.

For example to estimate the space required for a guest in a stored local disk called filename.img you could do:

 virt-v2v-inspector -i disk filename.img


The output from this tool is an XML document (written to stdout).

 <?xml version='1.0' encoding='utf-8'?>

The <program>, <package> and <version> elements refer to the current version of virt-v2v-inspector and are useful for debugging. Make sure you use the same version of virt-v2v-inspector and virt-v2v.

     <disk index='0'>
       <allocated estimated='true'>1400897536</allocated>
     <disk index='1'>
       <allocated estimated='true'>45131520</allocated>

The <disks> element lists information about each guest disk. The example virtual machine above has two disks. <virtual-size> describes the size of the disk as seen from inside the guest, while <allocated> is an estimate of how much storage will be needed on the host after conversion. This is assuming you use -oa sparse - see the notes below.


The <operatingsystem> element lists information about the guest operating system gleaned during conversion, in a manner similar to the virt-inspector(1) tool from guestfs-tools.

Output allocation mode and output format

Virt-v2v supports selecting the output allocation mode (-oa option) and output format (-of option, eg. -of qcow2). Since it is difficult to predict the effect of these options on the actual space occupied by the final image this tool does not account for them.

As a rule of thumb:

virt-v2v -oa preallocated

causes the disk images on the target to consume their full virtual size (excluding the effect of zero allocations will depends so much on the underlying storage that it is often hard even for experts to predict).

virt-v2v -of qcow2

uses the QCOW2 format where supported which means that the apparent size of the file will be equal to its sparse size, but otherwise should not affect estimates very much.



Display help.


Enable verbose messages for debugging.


Display version number and exit.


Enable tracing of libguestfs API calls.

-i ...
-ic ...
-if ...
-io ...
-ip ...
-it ...

All of the -i* options supported by virt-v2v and also supported by virt-v2v-inspector.

-b ...
--bridge ...
--key ...
--mac ...
-n ...
--network ...
--root ...

These options work in the same way as the equivalent virt-v2v options.


Files used are the same as for virt-v2v. See "FILES" in virt-v2v(1).


Environment variables used are the same as for virt-v2v. See "ENVIRONMENT VARIABLES" in virt-v2v(1).


virt-v2v(1), virt-p2v(1), virt-inspector(1), guestfs(3), guestfish(1), qemu-img(1), nbdkit(1),


Matthew Booth

Cédric Bosdonnat

Laszlo Ersek

Tomáš Golembiovský

Shahar Havivi

Richard W.M. Jones

Roman Kagan

Mike Latimer

Nir Soffer

Pino Toscano

Xiaodai Wang

Ming Xie

Tingting Zheng


Copyright (C) 2009-2022 Red Hat Inc.


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


To get a list of bugs against libguestfs, use this link:

To report a new bug against libguestfs, use this link:

When reporting a bug, please supply: