Bug 824275

Summary: create a new guest with virt-manager then migrate it to DST, guest will autostart on source host
Product: Red Hat Enterprise Linux 6 Reporter: zhpeng
Component: virt-managerAssignee: Gunannan Ren <gren>
Status: CLOSED ERRATA QA Contact: Nobody <nobody>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: cwei, dallan, dyasny, dyuan, gkong, jwu, mzhan, rwu, tzheng, weizhan, ydu, yupzhang, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-manager-0.9.0-15.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 10:46:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
guest xml generate by virt-manager
none
virt-manager log none

Description zhpeng 2012-05-23 06:55:06 UTC
Description of problem:
1.create a new guest with virt-manager then migrate it to DST, guest will autostart on source host.
2.create a new guest with virt-manager(import disk image), and run halt in guest, then guest will boot up again.

Version-Release number of selected component (if applicable):
libvirt-0.9.10-20.el6.x86_64
virt-manager-0.9.0-14.el6.x86_64
python-virtinst-0.600.0-8.el6.noarch

How reproducible:
very often

Steps to Reproduce:
6 scenses here:
ENV:nfs pool shared between source host and DST host.

A) 1 Use virt-manager create a new guest use "import existing disk image".
   2 The guest will start after you finished guest configuration, then login in guest, DO NOT RUN ANY OTHER COMMANDS, just login in and run # halt
   3 guest will auto boot up again.
In step 1-3 pls DO NOT CLOSE virt-manager

B) 1 Use virt-manager create a new guest use "import existing disk image".
   2 The guest will start after you finished guest configuration, then login in, RUN SOME COMMANDS, then run # halt
   3 guest will auto boot up again (50% reproduce)
In step 1-3 pls DO NOT CLOSE virt-manager

C) 1 use virt-manager create a new guest use "import existing disk image".The guest will start after you finished guest configuration.And DO NOT CLOSE virt-manager.
   2 migrate it to DST
   3 guest will auto boot up on Source host again.

D) 1 use virt-manager create a new guest use "import existing disk image".The guest will start after you finished guest configuration.And DO NOT CLOSE virt-manager
   2 login in the guest and run some commands
   3 migrate the guest to DST
   4 guest will auto boot up on Source host again.



Expected results:
scenes from A to D, guest should not boot up again

Additional info:

E) if use virt-manager only(guest create and migration) guest will not boot up again on source host

F) if use virsh command only (define, start or create and migration) guest will not boot up again on source host
Actual results:

Comment 1 zhpeng 2012-05-23 06:57:45 UTC
Created attachment 586261 [details]
guest xml generate by virt-manager

Comment 2 zhpeng 2012-05-23 07:15:48 UTC
Best way to reproduce sence C and D is migrate guest when guest not finished boot up.

Comment 3 zhpeng 2012-05-23 07:16:38 UTC
Created attachment 586265 [details]
virt-manager log

Comment 5 yanbing du 2012-05-23 07:47:50 UTC
It's not the migration problem, even i import a domain via virt-manager then destroy it, the domain will auto start again. In fact, autostart is disabled as default.

Comment 7 RHEL Program Management 2012-07-10 06:23:58 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 8 RHEL Program Management 2012-07-11 01:57:26 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 9 Dave Allan 2012-07-26 18:26:26 UTC
(In reply to comment #5)
> It's not the migration problem, even i import a domain via virt-manager then
> destroy it, the domain will auto start again. In fact, autostart is disabled
> as default.

This behavior does not reproduce for me with this set of steps to reproduce.  I wonder if something else is going on with this system.

Comment 10 zhpeng 2012-07-27 09:12:07 UTC
(In reply to comment #9)
> (In reply to comment #5)
> > It's not the migration problem, even i import a domain via virt-manager then
> > destroy it, the domain will auto start again. In fact, autostart is disabled
> > as default.
> 
> This behavior does not reproduce for me with this set of steps to reproduce.
> I wonder if something else is going on with this system.

DA,

Test with:
libvirt-0.9.10-20
libvirt-0.9.13-3
virt-manager-0.9.0-14

I can reproduce it as comment 5.
Steps:

1. prepare a rhel6 guest image without gnome 
2. use virt-manager create a guest use the image.
3. the guest will boot up. then login.
4. run # halt  directly
5. guest will shutdown, and will auto boot up.

So i don't think it's env problem of ydu's machine...

Comment 11 Dave Allan 2012-09-12 01:42:26 UTC
Guannan, can you try to reproduce this behavior?

Comment 12 Gunannan Ren 2012-09-19 05:38:11 UTC
This a fixed problem in virt-manager upstream.
Virt-Manager should only reboot guesy if it just had an install phase.
For the operation of import existing disk image, virt-manager shouldn't perform restart operation.

commit b2c95375a36e8b3b97d77f1740ad64fb521486fb
Author: Cole Robinson <crobinso>
Date:   Mon Feb 13 15:47:06 2012 -0500

    create: Only reboot VM if it had an install phase

it needs backport work to RHEL6.4

Comment 14 Gunannan Ren 2012-09-22 13:47:34 UTC
backport patch has been sent out.
http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-September/msg00607.html

Set status to POST.

Comment 16 tingting zheng 2012-10-16 06:30:37 UTC
Tested the bug with:
libvirt-0.10.2-2.el6.x86_64
virt-manager-0.9.0-15.el6.x86_64

Steps:
A: 1 Use virt-manager create a new guest use "import existing disk image".
   2 The guest will start after you finished guest configuration, then login in guest, DO NOT RUN ANY OTHER COMMANDS, just login in and run # halt
   3 guest will shutoff.

B: 1 Use virt-manager create a new guest use "import existing disk image".
   2 The guest will start after you finished guest configuration, then login in, RUN SOME COMMANDS, then run # halt
   3 guest will shutoff.


C: 1 use virt-manager create a new guest use "import existing disk image".The guest will start after you finished guest configuration.And DO NOT CLOSE virt-manager.
   2 migrate it to DST
   3 guest is shutoff on Source host.

D: 1 use virt-manager create a new guest use "import existing disk image".The guest will start after you finished guest configuration.And DO NOT CLOSE virt-manager
   2 login in the guest and run some commands
   3 migrate the guest to DST
   4 guest is shutoff on Source host.

For the above 4 scenarios,tested each several times,it works fine,so change the bug to VERIFIED.

Comment 18 errata-xmlrpc 2013-02-21 10:46:59 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/RHBA-2013-0451.html