Bug 1670491

Summary: [RFE] Enable/Disable VM autostart
Product: Red Hat Enterprise Linux 8 Reporter: Sachin Raje <sraje>
Component: cockpit-appstreamAssignee: Martin Pitt <mpitt>
Status: CLOSED ERRATA QA Contact: YunmingYang <yunyang>
Severity: low Docs Contact:
Priority: low    
Version: 8.0CC: jcoscia, kkoukiou, qiyuan, skobyda
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.1   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 20:41:39 UTC Type: Feature Request
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: 1678935    
Bug Blocks:    
Attachments:
Description Flags
VM Autostart Disabled
none
VM Autostart Enabled none

Description Sachin Raje 2019-01-29 16:41:13 UTC
Created attachment 1524729 [details]
VM Autostart Disabled

Description of problem:
Cannot Edit Vm "Autostart" enabled/ disabled option from host cockpit portal.


Version-Release number of selected component (if applicable):

Red Hat Enterprise Linux release 8.0 Beta (Ootpa)
cockpit-machines-184-1.el8.noarch

How reproducible:
Always


Steps to Reproduce:
1. Create a New VM from "Virtula Machines" tab of cockpit portal.
2. Under VM 'Overview' tab, Autostart always shows 'disabled'.


Actual results:
Missing the way to 'enable / disable' the VM Autostart using cockpit portal.


Expected results:
There should be an option to 'Enable / Disable' the "Autostart" option for VM from cockpit portal.

Additional info:
Virtual Machine Manager in RHEL 7 has the option to "Enable / Disable" VM Autostart option under VM "Boot Options".

Comment 1 Sachin Raje 2019-01-29 16:42:08 UTC
Created attachment 1524730 [details]
VM Autostart Enabled

Comment 2 Sachin Raje 2019-01-29 16:43:09 UTC
From command line can enable / disable the vm autostart.

For Example,

1. The VM dominfo : By default "Autostart" is Disabled.

# virsh dominfo testvm
Id:             -
Name:           testvm
UUID:           4252500d-4fe0-4c4d-beb3-6ffe55432136
OS Type:        hvm
State:          shut off
CPU(s):         1
Max memory:     2097152 KiB
Used memory:    2097152 KiB
Persistent:     yes
Autostart:      disable   <<==
Managed save:   no
Security model: selinux
Security DOI:   0



2. Enabled the "Autostart" for VM using 'virsh' command :

# virsh autostart testvm
Domain testvm marked as autostarted

# virsh dominfo testvm
Id:             -
Name:           testvm
UUID:           4252500d-4fe0-4c4d-beb3-6ffe55432136
OS Type:        hvm
State:          shut off
CPU(s):         1
Max memory:     2097152 KiB
Used memory:    2097152 KiB
Persistent:     yes
Autostart:      enable    <<==
Managed save:   no
Security model: selinux
Security DOI:   0

# ll /etc/libvirt/qemu/autostart/
total 0
lrwxrwxrwx. 1 root root 28 Jan 29 20:28 testvm.xml -> /etc/libvirt/qemu/testvm.xml


3. Disable the "Autostart" for VM using 'virsh' command :  

# virsh autostart --disable testvm
Domain testvm unmarked as autostarted

# virsh dominfo testvm
Id:             1
Name:           testvm
UUID:           4252500d-4fe0-4c4d-beb3-6ffe55432136
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       63.0s
Max memory:     2097152 KiB
Used memory:    2097152 KiB
Persistent:     yes
Autostart:      disable   <<==
Managed save:   no
Security model: selinux
Security DOI:   0
Security label: system_u:system_r:svirt_t:s0:c606,c804 (enforcing)

# ll /etc/libvirt/qemu/autostart/
total 0

Comment 3 Simon Kobyda 2019-01-30 16:18:04 UTC
Pull Request created, referencing this issue: https://github.com/cockpit-project/cockpit/pull/11083

Comment 4 Katerina Koukiou 2019-03-11 08:36:25 UTC
This was implemented by:

commit ff9c62f7bf7736a9727f6ee0d0482b174b5c7ce5
Author: skobyda <42733240+skobyda.github.com>
Date:   Fri Feb 8 13:03:55 2019 +0100

    machines: Add autostart option for VM
    
    Implementation of a simple checkbox, so user can choose whetever certain VM
    starts at the host's boot time.
    
    Closes #11083


$ git describe ff9c62f7bf7736a9727f6ee0d0482b174b5c7ce5
187-11-gff9c62f7b

Comment 5 Martin Pitt 2019-03-13 11:36:22 UTC
*** Bug 1683342 has been marked as a duplicate of this bug. ***

Comment 7 YunmingYang 2019-05-29 02:50:45 UTC
Test Versions:
cockpit-machines-193-1.el8.noarch
libvirt-dbus-1.2.0-2.module+el8.1.0+2983+b2ae9c0a.x86_64


Test Steps:
1.Check the 'Autostart' checkbox which is on the overview tab of the VM row.Then use command which is 'virsh dominfo ${vmname}' to make sure the setting has been in effect.
1.Uncheck the 'Autostart' checkbox which is on the overview tab of the VM row.Then use command which is 'virsh dominfo ${vmname}' to make sure the setting has been in effect


Test Results:
1.The option of 'Autostart' can be checked on the page, and the setting is in effect by using command which is 'virsh dominfo ${vmname}'


According to the results, The 'autostart' option can be set from the page.So move the status to VERIFIED.

Comment 9 errata-xmlrpc 2019-11-05 20:41:39 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.

https://access.redhat.com/errata/RHBA-2019:3325