<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Текст Знак";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
span.a
        {mso-style-name:"Текст Знак";
        mso-style-priority:99;
        mso-style-link:Текст;
        font-family:"Calibri","sans-serif";}
span.shorttext
        {mso-style-name:short_text;}
span.hps
        {mso-style-name:hps;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:192113549;
        mso-list-type:hybrid;
        mso-list-template-ids:-667618144 68747279 68747289 68747291 68747279 68747289 68747291 68747279 68747289 68747291;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="RU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText"><span lang="EN-US" style="mso-fareast-language:RU">-----Original Message-----<br>
From: Richard W.M. Jones [mailto:rjones@redhat.com] <br>
Sent: Friday, January 17, 2014 6:46 PM<br>
To: </span><span style="mso-fareast-language:RU">Исаев</span><span style="mso-fareast-language:RU">
</span><span style="mso-fareast-language:RU">Виталий</span><span style="mso-fareast-language:RU">
</span><span style="mso-fareast-language:RU">Анатольевич</span><span lang="EN-US" style="mso-fareast-language:RU"><br>
Cc: libguestfs@redhat.com<br>
Subject: Re: [Libguestfs] LVM mounting issue</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText">On Fri, Jan 17, 2014 at 02:38:43PM +0000, Исаев Виталий Анатольевич wrote:<o:p></o:p></p>
<p class="MsoPlainText">> 3.       Now I go to the RHEV-H to look for the disk image itself:<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> [root@rhevh1 /]# find / -name cc6e4400-7c98-4170-9075-5f5790dfcff3<o:p></o:p></p>
<p class="MsoPlainText">> /dev/1a9aa971-f81f-4ad8-932f-607034c924fc/cc6e4400-7c98-4170-9075-5f57<o:p></o:p></p>
<p class="MsoPlainText">> 90dfcff3<o:p></o:p></p>
<p class="MsoPlainText">> /var/lib/stateless/writable/rhev/data-center/mnt/blockSD/1a9aa971-f81f<o:p></o:p></p>
<p class="MsoPlainText">> -4ad8-932f-607034c924fc/images/8a3e02de-d8ab-4357-ba8c-490f3ba3e85c/cc<o:p></o:p></p>
<p class="MsoPlainText">> 6e4400-7c98-4170-9075-5f5790dfcff3<o:p></o:p></p>
<p class="MsoPlainText">> /rhev/data-center/mnt/blockSD/1a9aa971-f81f-4ad8-932f-607034c924fc/ima<o:p></o:p></p>
<p class="MsoPlainText">> ges/8a3e02de-d8ab-4357-ba8c-490f3ba3e85c/cc6e4400-7c98-4170-9075-5f579<o:p></o:p></p>
<p class="MsoPlainText">> 0dfcff3<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> 4.       Note that all these files are symbolic links:<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> [root@rhevh1 /]# find / -name cc6e4400-7c98-4170-9075-5f5790dfcff3
<o:p></o:p></p>
<p class="MsoPlainText">> -exec readlink -f {} \;<o:p></o:p></p>
<p class="MsoPlainText">> /dev/dm-40<o:p></o:p></p>
<p class="MsoPlainText">> /dev/dm-40<o:p></o:p></p>
<p class="MsoPlainText">> /dev/dm-40<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> 5.       One more symbolic link is in /dev/mapper:<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> [root@rhevh1 /]# ls -l <o:p></o:p></p>
<p class="MsoPlainText">> /dev/mapper/1a9aa971--f81f--4ad8--932f--607034c924fc-cc6e4400--7c98--4<o:p></o:p></p>
<p class="MsoPlainText">> 170--9075--5f5790dfcff3 lrwxrwxrwx. 1 root root 8 2013-11-20 10:59
<o:p></o:p></p>
<p class="MsoPlainText">> /dev/mapper/1a9aa971--f81f--4ad8--932f--607034c924fc-cc6e4400--7c98--4<o:p></o:p></p>
<p class="MsoPlainText">> 170--9075--5f5790dfcff3 -> ../dm-40<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> 6.       So I have no choice and I try to open /dev/dm-40 with libguestfs or guestfish. What's next, you already know.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">You definitely do have a choice.  Don't open /dev/dm-40.  Open one of the other paths instead, eg:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">virt-inspector2 -v -x -a /var/lib/stateless/writable/rhev/data-center/mnt/blockSD/1a9aa971-f81f-4ad8-932f-607034c924fc/images/8a3e02de-d8ab-4357-ba8c-490f3ba3e85c/cc6e4400-7c98-4170-9075-5f5790dfcff3<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">It makes a big difference to qemu which path you use, because it searches for backing disks relative to the path of the original disk image.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Rich.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">--<o:p></o:p></p>
<p class="MsoPlainText"><span lang="EN-US">Richard Jones, Virtualization Group, Red Hat
</span><a href="http://people.redhat.com/~rjones"><span lang="EN-US" style="color:windowtext;text-decoration:none">http://people.redhat.com/~rjones</span></a><span lang="EN-US"> Fedora Windows cross-compiler.
</span>Compile Windows programs, test, and build Windows installers. Over 100 libraries supported.<o:p></o:p></p>
<p class="MsoPlainText"><a href="http://fedoraproject.org/wiki/MinGW"><span style="color:windowtext;text-decoration:none">http://fedoraproject.org/wiki/MinGW</span></a><o:p></o:p></p>
<p class="MsoPlainText"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US" style="color:black">Hello, Richard, I apologise for the late reply. It took me some time to work with a decision you have proposed and to continue discussion in
</span><a href="https://bugzilla.redhat.com/show_bug.cgi?id=1053684" title="NEW - Usage of the relative pathes for backing disks impedes the work of libguestfs (RHEV 3.1)"><span lang="EN-US">bug 1053684</span></a><span lang="EN-US">.
<o:p></o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US">What I tried to do is to launch libguestfs tests with disk images not from /dev/mapper or directly from /dev/ but from /var/lib/stateless/writable/rhev/data-center/mnt/blockSD/<…> instead.
 Unfortunately, the results were poor: I could not even access some of the images with libguestfs,
</span><span class="hps"><span lang="EN">whereas before</span></span><span class="shorttext"><span lang="EN">
</span></span><span class="hps"><span lang="EN">I succeeded to launch libguestfs with every image from /dev/dm-xx properly</span></span><span class="shorttext"><span lang="EN">.<o:p></o:p></span></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span class="shorttext"><span lang="EN"><o:p> </o:p></span></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span class="shorttext"><span lang="EN">I launched the script (test2.py is attached to this message) on both nodes of my cluster (node1 and node2 outputs are attached too) in order to test libguestfs work with
 your approach.<o:p></o:p></span></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span class="shorttext"><span lang="EN">Consider the following table (all vms are running):<o:p></o:p></span></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span class="shorttext"><span lang="EN"><o:p> </o:p></span></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">     VM   RUNNING ON NODE     DISK IS ACCESSIBLE ON A NODE*<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">build_list      1                    1   
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">build-ss        1                    1<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">build-ss001     1                    -<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">build-ss002     1                    -<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">fs              2                    1,2<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">ipa1            1                    -<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">koji-build-test 2                    -<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">koji_hub        1                    1<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">koji-hub-test   2                    -<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">postgres        1                    -   
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">share           2                    1,2<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">test1           1                    1<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">ts2             1                    -<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">vc2             1                    1<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">vmbuild         1                    1<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">win7_32         2                    1,2<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">winxp           2                    1,2<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">    
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">* - disk was found in /var/lib/stateless/writable/rhev/data-center/mnt/blockSD/
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">and could be handled correctly with libguestfs tool<o:p></o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span class="shorttext"><span lang="EN"><o:p> </o:p></span></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span class="shorttext"><span lang="EN">So you can see that I did not manage to run libguestfs with disk 7 images. (It’s also quite strange for me that some disks are accesible on both nodes while the other
 disks are mapped to the only node – but this is oVirt-specified question).<o:p></o:p></span></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US">However, <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1053684#c14">
Comment 14</a> contains my workaround of this problem (recursive resolving of qcow2 disks into raw discs using `qemu-img` output). This workaround allowed accessing all the disks with libguestfs.
<o:p></o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US">Finally I would like to draw you attention to the machine that is different from all the other VMs (see the node1 output file). This the one from which we started this thread. It has a RHEL
 6.4 on a board and working fine. And it is the only VM which operating system is not able to be detected by libguestfs. Even when I launch libguestfs from the folder you recommended in your last message, I receive the same (virt-inspector2 -v -x output is
 attached to this message too):<o:p></o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">-------------------------------------------------------  2  ---------------------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">VM: 'build-ss' - disk_image_id: cc6e4400-7c98-4170-9075-5f5790dfcff3<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">     Trying to open /var/lib/stateless/writable/rhev/data-center/mnt/blockSD/1a9aa971-f81f-4ad8-932f-607034c924fc/images/8a3e02de-d8ab-4357-ba8c-490f3ba3e85c/cc6e4400-7c98-4170-9075-5f5790dfcff3<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">          guestfs succesfully launched<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">                Physical volumes: ['/dev/vda2', 'unknown device']<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">                Logical volumes: ['/dev/vg_kojit/lv_root', '/dev/vg_kojit/lv_swap']<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-family:"Courier New"">                Partitions: ['/dev/vda1', '/dev/vda2']<o:p></o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US" style="font-family:"Courier New"">                Operating systems: []<o:p></o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US" style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US">May be you have some idea about repairing this VM in order to provide the full libguestfs functionality? I need to get mountpoints and mount a filesystem.
<o:p></o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US">Thank you in advance!<o:p></o:p></span></p>
<p class="MsoPlainText" style="margin-left:35.4pt"><span lang="EN-US">Sincerely, <o:p>
</o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:10.0pt;mso-fareast-language:RU">Vitaly Isaev<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:10.0pt;color:gray;mso-fareast-language:RU">Software engineer<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:10.0pt;color:gray;mso-fareast-language:RU">Information security department<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:10.0pt;color:gray;mso-fareast-language:RU">Fintech JSC, Moscow, Russia<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>