Bug 733669

Summary: report a specific migration on failure due to hostname lookup failure
Product: Red Hat Enterprise Linux 6 Reporter: Andrew Cathrow <acathrow>
Component: vdsmAssignee: Federico Simoncelli <fsimonce>
Status: CLOSED ERRATA QA Contact: yeylon <yeylon>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: abaron, bazulay, dallan, danken, iheim, jbrier, jlibosva, moli, ofrenkel, rbalakri, srevivo, ykaul
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: vdsm-4.9-101 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 737809 (view as bug list) Environment:
Last Closed: 2011-12-06 07:25:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 734487, 737809    
Attachments:
Description Flags
bz733669.tar.gz none

Comment 2 Dan Kenigsberg 2011-08-26 22:10:44 UTC
Federico, would you double-check that libvirt fails migration when no dns entry
exists for the destination host (I'm definite that bad things happen with a
wrong dns entry).

Comment 6 Federico Simoncelli 2011-08-29 13:48:48 UTC
Created attachment 520402 [details]
bz733669.tar.gz

(In reply to comment #2)
> Federico, would you double-check that libvirt fails migration when no dns entry
> exists for the destination host (I'm definite that bad things happen with a
> wrong dns entry).

# hostname
vm-rhev3.telemaco.homelinux.net
# host vm-rhev3.telemaco.homelinux.net
vm-rhev3.telemaco.homelinux.net has address 192.168.123.43

<migration succeeded>

# hostname -v vm-rhev-none.telemaco.homelinux.net
Setting hostname to `vm-rhev-none.telemaco.homelinux.net'
# host vm-rhev-none.telemaco.homelinux.net
Host vm-rhev-none.telemaco.homelinux.net not found: 3(NXDOMAIN)

<migration failed>

Thread-163::ERROR::2011-08-29 13:10:02,010::clientIF::759::vds::(migrationCreate) Migration failed: local hostname is not correct
Thread-163::DEBUG::2011-08-29 13:10:02,011::clientIF::59::vds::(wrapper) return migrationCreate with {'status': {'message': 'Error creating the requested virtual machine', 'code': 9}}

# cp -a /usr/share/vdsm/clientIF.py /usr/share/vdsm/clientIF.py.orig
# diff -u /usr/share/vdsm/clientIF.py.orig /usr/share/vdsm/clientIF.py
--- /usr/share/vdsm/clientIF.py.orig	2011-08-26 09:37:17.000000000 +0000
+++ /usr/share/vdsm/clientIF.py	2011-08-29 13:14:22.393405372 +0000
@@ -755,9 +755,9 @@
         """
         self.log.debug('Migration create')
 
-        if not utils.validLocalHostname():
-            self.log.error('Migration failed: local hostname is not correct')
-            return errCode['createErr']
+#       if not utils.validLocalHostname():
+#           self.log.error('Migration failed: local hostname is not correct')
+#           return errCode['createErr']
 
         response = self.create(params)
         if response['status']['code']:

# service vdsmd restart

<migration failed>

On source (vm-rhev2) libvirtd crashes/restarts:

Thread-87::ERROR::2011-08-29 13:40:38,231::libvirtconnection::73::vds::(wrapper) connection to libvirt broken. taking vdsm down.
Thread-87::INFO::2011-08-29 13:40:38,232::dispatcher::94::Storage.Dispatcher.Protect::(run) Run and protect: prepareForShutdown, args: ()

On destination (vm-rhev3) the migration is reported as completed to vdsm:

Thread-40::DEBUG::2011-08-29 13:40:36,297::libvirtvm::1039::vm.Vm::(_waitForIncomingMigrationFinish) vmId=`654b3aa4-5fa9-4f26-b1b8-1f1ef386e90c`::End of migration

But the vm was never migrated.

Detailed logs as attachment.

Comment 21 Federico Simoncelli 2011-09-12 14:43:35 UTC
commit 55fefdfe26429a30e126a02f585b7119a4ff7cfc
Author: Federico Simoncelli <fsimonce>
Date:   Fri Sep 9 17:01:26 2011 +0000

    BZ#733669 Return specific error for invalid host
    
    Change-Id: Iaf0ae2d62772b01d05d9d5e62d2433c1758d69b1

http://gerrit.usersys.redhat.com/924

Comment 26 Jakub Libosvar 2011-10-19 15:01:04 UTC
Verified ic145, vdsm-108

Comment 27 errata-xmlrpc 2011-12-06 07:25:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2011-1782.html