<div dir="ltr">Hi,<div><br></div><div>I tried as you suggested, but floppy is not getting attached it seems. below is the code</div><div><br></div><div><br></div><div><br></div><div><b><u>Steps followed:</u></b></div><div>
<br></div><div>I. Create windows VM</div><div>II. installed host agent</div><div>III. <b><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">To
seal a Windows virtual machine with sysprep</span></b></div>

<ol start="1" type="1">
 <li class="MsoNormal" style="margin-left:0.5in;text-align:left"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">In the Windows virtual machine to be used as a
     template, open a command line terminal and type <b>regedit</b>. </span></li>
 <li class="MsoNormal" style="margin-left:0.5in;text-align:left"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">The <b>Registry Editor</b> window displays. On the left
     pane, expand <b>HKEY_LOCAL_MACHINE</b> → <b>SYSTEM</b> → <b>SETUP</b>. </span></li>
 <li class="MsoNormal" style="margin-left:0.5in;text-align:left"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">On the main window, right click to add a new string
     value using <b>New</b> → <b>String Value</b>. Right click on the string
     value file and select <b>Modify</b>. When the <b>Edit String</b> dialog
     box displays, fill in the provided text boxes: </span></li>
 <ul type="circle">
  <li class="MsoNormal" style="margin-left:0.5in;text-align:left"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">Value name: </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;">UnattendFile</span><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"> </span></li>

  <li class="MsoNormal" style="margin-left:0.5in;text-align:left"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">Value data: </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;">a:\sysprep.xml</span><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"></span></li>

 </ul>
 <li class="MsoNormal" style="margin-left:0.5in;text-align:left"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">Launch sysprep from </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;">C:\Windows\System32\sysprep\sysprep.exe</span><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"> </span></li>

 <ul type="circle">
  <li class="MsoNormal" style="margin-left:0.5in;text-align:left"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">Under <b>System Cleanup Action</b>,
      select <b>Enter System Out-of-Box-Experience (OOBE)</b>. </span></li>
  <li class="MsoNormal" style="margin-left:0.5in;text-align:left"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">Tick the <b>Generalize</b>
      checkbox if you need to change the computer&#39;s system identification
      number (SID). </span></li>
  <li class="MsoNormal" style="margin-left:0.5in;text-align:left"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">Under <b>Shutdown Options</b>,
      select <b>Shutdown</b>. </span></li>
 </ul>
</ol>

<p class="MsoNormal" align="left" style="margin-left:0.5in"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">Click
<b>OK</b>. The virtual machine will now go through the sealing process and shut
down automatically. </span></p><p class="MsoNormal" align="left" style="margin-left:0.5in"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><br></span></p><p class="MsoNormal" align="left" style="margin-left:0.5in">
<span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><br></span></p><p class="MsoNormal" align="left" style="margin-left:0.5in"><span style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">IV. </span></p>
<p class="MsoNormal" align="left" style="margin-left:0.5in"><br></p><div><span class="" style="white-space:pre">                        </span>  org.ovirt.engine.sdk.decorators.VM vm1 =  api.getVMs().get(vmName);</div><div><span class="" style="white-space:pre">                        </span>  Payloads payloads = new Payloads();</div>
<div><span class="" style="white-space:pre">                        </span>  Payload payload = new Payload();</div><div><span class="" style="white-space:pre">                        </span>  payload.setType(&quot;floppy&quot;);</div><div><span class="" style="white-space:pre">                        </span>  </div>
<div><span class="" style="white-space:pre">                        </span>  Files payloadFiles = new Files();</div><div><span class="" style="white-space:pre">                        </span>  File payloadFile = new File();</div><div><span class="" style="white-space:pre">                        </span>  payloadFile.setName(&quot;sysprep.xml&quot;);</div>
<div><span class="" style="white-space:pre">                        </span>  payloadFile.setContent(&quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;utf-8\&quot;?&gt; &lt;unattend xmlns=\&quot;urn:schemas-microsoft-com:unattend\&quot;&gt; <b>FILE CONTENT </b>&quot;&lt;/unattend&gt;&quot;);</div>
<div><span class="" style="white-space:pre">                        </span>  payloadFiles.getFiles().add(payloadFile);</div><div><span class="" style="white-space:pre">                        </span>  payload.setFiles(payloadFiles);</div><div><span class="" style="white-space:pre">                        </span>  vm1.setPayloads(payloads);</div>
<div><span class="" style="white-space:pre">                        </span>  Action action = new Action();</div><div><span class="" style="white-space:pre">                        </span>  vm1.start(action);</div><div><br></div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Thu, Mar 27, 2014 at 3:52 PM, Itamar Heim <span dir="ltr">&lt;<a href="mailto:iheim@redhat.com" target="_blank">iheim@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 03/27/2014 06:18 AM, Tejesh M wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can you guide me on sysprep with sample code &amp; sysprep file?<br>
<br>
</blockquote>
<br>
just launch a windows VM, look at the generated sysprep file we pass to the VM via the floppy disk.<br>
then pass it as a payload as-is.<br>
then try to change what you want.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Thu, Mar 27, 2014 at 3:16 PM, Itamar Heim &lt;<a href="mailto:iheim@redhat.com" target="_blank">iheim@redhat.com</a><br>
&lt;mailto:<a href="mailto:iheim@redhat.com" target="_blank">iheim@redhat.com</a>&gt;&gt; wrote:<br>
<br>
    On 03/27/2014 05:33 AM, Tejesh M wrote:<br>
<br>
        Hi All,<br>
<br>
        I was doing google to see if i can set Hostname,Password &amp; IP<br>
        details<br>
        for Windows server from RHEV-M. I got to know that we can create VM<br>
        Payload &amp; send that to Windows VM (installed with Cloud-init)<br>
<br>
        Refer this link<br>
        <a href="http://www.cloudbase.it/cloud-__init-for-windows-instances/#__comment-9411" target="_blank">http://www.cloudbase.it/cloud-<u></u>__init-for-windows-instances/#<u></u>__comment-9411</a><br>
        &lt;<a href="http://www.cloudbase.it/cloud-init-for-windows-instances/#comment-9411" target="_blank">http://www.cloudbase.it/<u></u>cloud-init-for-windows-<u></u>instances/#comment-9411</a>&gt;<br>
<br>
        Cloud-init expects Meta-data &amp; User-Data file to be sent either via<br>
        Config Drive or via HTTP. I&#39;m trying to achive this via ConfigDrive<br>
        (created using VM Payload).<br>
<br>
<br>
    note you can also just pass the full sysprep file as a payload<br>
    yourself via the API, and set all these items in it.<br>
<br>
<br>
        But i&#39;m wondering what should be the format of this two files<br>
        (Meta-data<br>
        &amp; User-data). Have any1  tried this? If yes, would request to share<br>
        sample for both the files with setting Hostname, Password &amp; IP<br>
        details.<br>
<br>
<br>
    just launch a linux VM and check the file we create?<br>
<br>
<br>
        Java code:<br>
<br>
            org.ovirt.engine.sdk.__<u></u>decorators.VM vm1 =<br>
          api.getVMs().get(vmName);<br>
                        Payloads payloads = new Payloads();<br>
                        Payload payload = new Payload();<br>
                        payload.setType(&quot;cdrom&quot;);<br>
<br>
                        Files payloadFiles = new Files();<br>
                        File payloadFile = new File();<br>
                        payloadFile.setName(&quot;meta-__<u></u>data.txt&quot;);<br>
                        payloadFile.setContent(&quot;__<u></u>hostname:&quot;+vmName);<br>
                        payloadFiles.getFiles().add(__<u></u>payloadFile);<br>
                        payload.setFiles(payloadFiles)<u></u>__;<br>
                        vm1.setPayloads(payloads);<br>
                        Action action = new Action();<br>
                        vm1.start(action);<br>
<br>
        --<br>
        Thanks &amp; Regards<br>
        Tejesh<br>
<br>
<br>
<br>
<br><span class="HOEnZb"><font color="#888888">
<br>
--<br>
Thanks &amp; Regards<br>
Tejesh<br>
</font></span></blockquote>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Thanks &amp; Regards</div>
<div>Tejesh</div>
</div>