Bug 1190663 - [sysprep] Sysprep floppy payload attached to normal VM regardless of its settings enabling
Summary: [sysprep] Sysprep floppy payload attached to normal VM regardless of its sett...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Shahar Havivi
QA Contact: sefi litmanovich
URL:
Whiteboard:
Depends On:
Blocks: 1240900 1292086
TreeView+ depends on / blocked
 
Reported: 2015-02-09 11:27 UTC by Jiri Belka
Modified: 2016-04-20 01:31 UTC (History)
12 users (show)

Fixed In Version: 3.6.0-4 alpha3
Doc Type: Bug Fix
Doc Text:
Cause: On starting any windows VM we use to attach a floppy to the VM on the first run with the Sysprep configuration data regardless if the user explicitly enable/disable Sysprep. Result: Only enable sysprep VM (add/edit VM -> initial run) or via run once with explicit user request we attach sysprep data.
Clone Of:
: 1240900 (view as bug list)
Environment:
Last Closed: 2016-04-20 01:31:00 UTC
oVirt Team: Virt
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
engine.log, vdsm.log (380.21 KB, application/x-gzip)
2015-02-09 11:27 UTC, Jiri Belka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 40987 0 'None' 'MERGED' 'engine: Sysprep attached by default on new Windows VMs' 2019-12-04 16:13:34 UTC
oVirt gerrit 43100 0 'None' 'MERGED' 'restapi: add use_sysprep and use_cloud_init for Vm creation' 2019-12-04 16:13:34 UTC
oVirt gerrit 43385 0 'None' 'MERGED' 'restapi: add use_sysprep and use_cloud_init for Vm creation' 2019-12-04 16:13:33 UTC
oVirt gerrit 48321 0 'None' 'MERGED' 'UI: sysprep attached by default in run once dialog.' 2019-12-04 16:13:33 UTC

Description Jiri Belka 2015-02-09 11:27:18 UTC
Created attachment 989651 [details]
engine.log, vdsm.log

Description of problem:
<intro>libvirtd has sometimes an issue to access a file (payload) and thus the VM doesn't start correctly.</intro>

while investigating i discovered that sysprep payload is _always_ attached to windows on my environment. this seems odd.

Version-Release number of selected component (if applicable):
rhevm-backend-3.5.0-0.31.el6ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. new VM - windows in User Portal/Extended
2. add disk
3. click Run

Actual results:
a sysprep payload is attached

Expected results:
sysprep should be attached only when enabled in settings for _normal_ vms (not talking about pools here!)

Additional info:
qemu-kvm ... -drive file=/var/run/vdsm/payload/6fd556bc-d977-4027-8198-c45fc192524d.efc6e1e124c6da19b465d190c4f35ce5.img,if=none,id=drive-fdc0-0-0,readonly=on,format=raw,serial= -global isa-fdc.driveA=drive-fdc0-0-0 ...

Comment 1 Jiri Belka 2015-02-09 11:29:14 UTC
<vm href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d" id="6fd556bc-d977-4027-8198-c45fc192524d"><actions><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/ticket" rel="ticket"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/reboot" rel="reboot"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/migrate" rel="migrate"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/clone" rel="clone"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/commit_snapshot" rel="commit_snapshot"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/preview_snapshot" rel="preview_snapshot"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/logon" rel="logon"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/cancelmigration" rel="cancelmigration"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/maintenance" rel="maintenance"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/undo_snapshot" rel="undo_snapshot"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/detach" rel="detach"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/move" rel="move"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/export" rel="export"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/shutdown" rel="shutdown"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/start" rel="start"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/stop" rel="stop"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/suspend" rel="suspend"/></actions><name>bugzilla</name><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/applications" rel="applications"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/disks" rel="disks"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/nics" rel="nics"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/numanodes" rel="numanodes"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/cdroms" rel="cdroms"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/snapshots" rel="snapshots"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/tags" rel="tags"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/permissions" rel="permissions"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/statistics" rel="statistics"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/reporteddevices" rel="reporteddevices"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/watchdogs" rel="watchdogs"/><link href="/api/vms/6fd556bc-d977-4027-8198-c45fc192524d/sessions" rel="sessions"/><type>desktop</type><status><state>down</state></status><stop_reason/><memory>1073741824</memory><cpu><topology sockets="1" cores="1"/><architecture>X86_64</architecture></cpu><cpu_shares>0</cpu_shares><bios><boot_menu><enabled>false</enabled></boot_menu></bios><os type="windows_2008x64"><boot dev="hd"/></os><high_availability><enabled>false</enabled><priority>1</priority></high_availability><display><type>vnc</type><monitors>1</monitors><single_qxl_pci>false</single_qxl_pci><allow_override>false</allow_override><smartcard_enabled>false</smartcard_enabled><file_transfer_enabled>true</file_transfer_enabled><copy_paste_enabled>true</copy_paste_enabled></display><cluster href="/api/clusters/00000001-0001-0001-0001-000000000390" id="00000001-0001-0001-0001-000000000390"/><template href="/api/templates/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"/><stop_time>2015-02-09T12:24:22.602+01:00</stop_time><creation_time>2015-02-09T12:22:08.482+01:00</creation_time><origin>ovirt</origin><stateless>false</stateless><delete_protected>false</delete_protected><sso><methods><method id="GUEST_AGENT"/></methods></sso><timezone>GMT Standard Time</timezone><payloads><payload type="floppy"><files><file><name>sysprep.inf</name><content><?xml version="1.0" encoding="utf-8"?>

<unattend xmlns="urn:schemas-microsoft-com:unattend">

    <settings pass="specialize">

        <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <Identification>

                <Credentials>

                    <!-- Identification/JoinDomain -->

                    <Domain><![CDATA[]]></Domain>

                    <!-- Identification/DomainAdminPassword-->

                    <Password><![CDATA[]]></Password>

                    <!-- Identification/DomainAdmin -->

                    <Username><![CDATA[]]></Username>

                </Credentials>

                <JoinDomain><![CDATA[]]></JoinDomain>

                <DebugJoin>true</DebugJoin>

                <MachineObjectOU><![CDATA[]]></MachineObjectOU>

            </Identification>

        </component>

        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <!-- UserData/ComputerName -->

	    <ComputerName><![CDATA[bugzilla]]></ComputerName>

            <!-- UserData/OrgName -->

	    <RegisteredOrganization><![CDATA[rhev.lab.eng.brq.redhat.com]]></RegisteredOrganization>

            <!-- UserData/FullName -->

            <RegisteredOwner>User</RegisteredOwner>

        </component>

    </settings>

    <settings pass="oobeSystem">

        <component name="Microsoft-Windows-IE-ClientNetworkProtocolImplementation" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

	    <!-- Proxy/ProxyEnabled -->

            <HKLMProxyEnable>false</HKLMProxyEnable>

        </component>

        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <Display>

		<!-- Display/BitsPerPixel -->

                <ColorDepth>32</ColorDepth>

		<!-- Display/Xresolution -->			

                <HorizontalResolution>1024</HorizontalResolution>

		<!-- Display/Vrefresh -->

                <RefreshRate>75</RefreshRate>

		<!-- Display/Yresolution -->

                <VerticalResolution>768</VerticalResolution>

            </Display>

            <OOBE>

                <SkipUserOOBE>true</SkipUserOOBE>

                <HideEULAPage>true</HideEULAPage>

            </OOBE>

            <UserAccounts>

                  <!-- GuiUnattended/AdminPassword -->

                <AdministratorPassword>

                    <Value><![CDATA[123456]]></Value>

                  <!-- GuiUnattended/EncryptedAdminPassword -->

                    <PlainText>true</PlainText>

                </AdministratorPassword>

            </UserAccounts>

		<!-- GuiUnattended/TimeZone -->

            <TimeZone><![CDATA[GMT Standard Time]]></TimeZone>

            <!-- UserData/OrgName -->

	    <RegisteredOrganization><![CDATA[rhev.lab.eng.brq.redhat.com]]></RegisteredOrganization>

            <!-- UserData/FullName -->

            <RegisteredOwner>User</RegisteredOwner>

        </component>

        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

		<!-- REgionalSettings/Language -->

            <InputLocale>0409:00000409</InputLocale>

            <SystemLocale><![CDATA[en_US]]></SystemLocale>

            <UILanguage><![CDATA[en_US]]></UILanguage>

            <UILanguageFallback>en-us</UILanguageFallback>

            <UserLocale><![CDATA[en_US]]></UserLocale>

        </component>

    </settings>

    <settings pass="windowsPE">

        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <UserData>

		<!-- GuiUnattended/OemSkipWelcome -->

                <AcceptEula>true</AcceptEula>

                <FullName>User</FullName>

                <Organization><![CDATA[rhev.lab.eng.brq.redhat.com]]></Organization>

                <ProductKey>

                  <Key><![CDATA[]]></Key>

                  <WillShowUI>Never</WillShowUI>

                </ProductKey>

            </UserData>

        </component>

        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <SetupUILanguage>

                <UILanguage>en-us</UILanguage>

            </SetupUILanguage>

		<!-- REgionalSettings/Language -->

            <InputLocale>0409:00000409</InputLocale>

            <SystemLocale>en-us</SystemLocale>

            <UILanguage>en-us</UILanguage>

            <UILanguageFallback>en-us</UILanguageFallback>

            <UserLocale>en-us</UserLocale>

        </component>

    </settings>

    <cpi:offlineImage cpi:source="wim:c:/osc/sources/install.wim#Windows Longhorn SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />

</unattend>

</content></file></files></payload></payloads><placement_policy><affinity>migratable</affinity></placement_policy><memory_policy><guaranteed>1073741824</guaranteed><ballooning>true</ballooning></memory_policy><quota id="10b05cce-9c10-4342-9580-6ce1a2d9beae"/><usb><enabled>false</enabled></usb><migration_downtime>-1</migration_downtime><cpu_profile href="/api/cpuprofiles/0000001a-001a-001a-001a-00000000037c" id="0000001a-001a-001a-001a-00000000037c"/><next_run_configuration_exists>false</next_run_configuration_exists><numa_tune_mode>interleave</numa_tune_mode></vm>

Comment 2 Omer Frenkel 2015-02-11 11:49:43 UTC
the engine always attach sysprep file to windows vms on first run.
this is because it is assumed vm is created from template and sysprep file will contain some initialization data, and in case its not needed, there is no harm with sending this floppy, so i don't think this is high severity.

that said, now there is an option for the user to enable/disable sysprep/cloud-init, so i guess we can change to this:
* to preserve current behavior: in UI/REST - for windows, by default, enable sysprep
* if user disabled sysprep, don't send it, even if it is first run (like it is for cloud-init)

Comment 3 Jiri Belka 2015-02-11 11:58:00 UTC
> it is assumed vm is created from template

it would be nice if the functionality would not try to be more clever than needed, too many "if(s)" (if windows os, if first run... [if, if...] then attach sysprep...).

i tried to find the behavior in docs but i found nothing, so this behavior is undocumented...

Comment 4 Juan Hernández 2015-03-12 14:55:32 UTC
For the RESTAPI I'd suggest to add a parameter to indicate explicitly if the sysprep or cloud-init support should be used, something similar to this:

  POST /vms/{vm:id}/start
  <action>
    <use_sysprep>true|false</use_sysprep>
    ...
  </action>

  POST /vms/{vm:id}/start
  <action>
    <use_cloud_init>true|false</use_cloud_init>
    ...
  </action>

This would make things clearer for users, no need to guess what will be the reaction of the server.

For backwards compatibility the default values of those parameters should be such that the behaviour is the same that today.

Comment 6 Michal Skrivanek 2015-06-30 14:25:38 UTC
(In reply to Juan Hernández from comment #4)
> For the RESTAPI I'd suggest to add a parameter to indicate explicitly if the
> sysprep or cloud-init support should be used, something similar to this:
> 
>   POST /vms/{vm:id}/start
>   <action>
>     <use_sysprep>true|false</use_sysprep>
>     ...
>   </action>
> 
>   POST /vms/{vm:id}/start
>   <action>
>     <use_cloud_init>true|false</use_cloud_init>
>     ...
>   </action>
> 
> This would make things clearer for users, no need to guess what will be the
> reaction of the server.
> 
> For backwards compatibility the default values of those parameters should be
> such that the behaviour is the same that today.

I guess that would work, but we would need to add <use_sysprep>true|false|first_time_only</use_sysprep> to be able to express the former behavior

Comment 8 sefi litmanovich 2015-11-16 13:40:14 UTC
verified with rhevm-3.6.0.3-0.1.el6.noarch.

Created 3 VMs:

1) started from gui with default values (sysprep is disabled) - result: no floppy payload in VMs xml.
stopped VM then started from rest-api with <use_sysprep>true<use_sysprep> tag - result: floppy payload exists.

2) In gui edited vm and chose use cloud_init/sysprep option. Started the VM in gui  - result: floppy payload exists.
stopped VM and started from rest-api with <use_sysprep>false<use_sysprep> tag - result: no floppy payload in VMs xml.

3) In gui started VM with runOnce - sysprep floppy is enabled by default - result: floppy payload exist.
stopped VM then again runOnce this time disabling floppy disk with sysprep - result no floppy payload in VMs xml.

It seems that all the cases are covered and behave as expected.


Note You need to log in before you can comment on or make changes to this bug.