Skip to contentSkip to conversation

KVM test: Add a new (optional) extra param to VM, cdrom_extra

PATCH New Lucas Meneghel Rodrigues 1 participant 2 messages Jan 18, 2010 KVM

lore
Share & tools
lore
#1 lore raw

PATCH 2/2 Fix windows unattended setup for rss.exe

In reply to Lucas Meneghel Rodrigues

Make unattended install for windows guests
use the extra cd, so it's possible to setup
rss.exe for remote connection.

---
 client/tests/kvm/tests_base.cfg.sample             |    1 +
 client/tests/kvm/unattended/win2003-32.sif         |   13 +++++++------
 client/tests/kvm/unattended/win2003-64.sif         |    3 ++-
 .../kvm/unattended/win2008-32-autounattend.xml     |    4 ++++
 .../kvm/unattended/win2008-64-autounattend.xml     |   10 +++++++---
 .../kvm/unattended/win2008-r2-autounattend.xml     |   10 +++++++---
 .../tests/kvm/unattended/win7-32-autounattend.xml  |   10 +++++++---
 .../tests/kvm/unattended/win7-64-autounattend.xml  |   10 +++++++---
 .../kvm/unattended/winvista-32-autounattend.xml    |   16 ++++++++++------
 .../kvm/unattended/winvista-64-autounattend.xml    |    4 ++--
 client/tests/kvm/unattended/winxp32.sif            |    5 +++--
 11 files changed, 57 insertions(+), 29 deletions(-)
client/tests/kvm/tests_base.cfg.sample +1 -0
index c42386d..b1b1539 100644
@@ -602,6 +602,7 @@ variants:
         unattended_install:
             timeout = 7200
             finish_program = deps/finish.exe
+            cdrom_extra = windows/winutils.iso
         migrate:
             migration_test_command = ver && vol
             migration_bg_command = start ping -t localhost
client/tests/kvm/unattended/win2003-32.sif +7 -6
index 374d4c4..5b9bf0e 100644
@@ -14,7 +14,7 @@ WaitForReboot = no
 Repartition = yes
 
 [GuiUnattended]
-AdminPassword = "123456"
+AdminPassword = "1q2w3eP"
 AutoLogon = Yes
 AutoLogonCount = 5
 OEMSkipRegional = 1
@@ -34,7 +34,7 @@ AutoUsers=15
 [Identification]
 	DoOldStyleDomainJoin = YES
 	DomainAdmin="Administrator"
-	DomainAdminPassword="123456"
+	DomainAdminPassword="1q2w3eP"
     JoinWorkgroup=WORKGROUP
 	JoinDomain="qe.redhat.com"
 
@@ -56,7 +56,8 @@ Mode = 0
 local="Local Area Connection"
 
 [GuiRunOnce]
-Command0="sc config TlntSvr start= auto"
-Command1="netsh firewall set opmode disable"
-Command2="net start telnet"
-Command3="cmd /c netsh interface ip set address local static 10.0.2.15 255.255.255.0 10.0.2.2 1 && ping 10.0.2.2 -n 20 && A:\finish.exe 10.0.2.2"
+Command0="cmd /c sc config TlntSvr start= auto"
+Command1="cmd /c netsh firewall set opmode disable"
+Command2="cmd /c net start telnet"
+Command3="cmd /c E:\setuprss.bat"
+Command4="cmd /c netsh interface ip set address local static 10.0.2.15 255.255.255.0 10.0.2.2 1 && ping 10.0.2.2 -n 20 && A:\finish.exe 10.0.2.2"
client/tests/kvm/unattended/win2003-64.sif +2 -1
index fe468cb..aca24fe 100644
@@ -58,4 +58,5 @@ local="Local Area Connection"
 Command0="cmd /c sc config TlntSvr start= auto"
 Command1="cmd /c netsh firewall set opmode disable"
 Command2="cmd /c net start telnet"
-Command3="cmd /c netsh interface ip set address local static 10.0.2.15 255.255.255.0 10.0.2.2 1 && ping 10.0.2.2 -n 20 && A:\finish.exe 10.0.2.2"
+Command3="cmd /c E:\setuprss.bat"
+Command4="cmd /c netsh interface ip set address local static 10.0.2.15 255.255.255.0 10.0.2.2 1 && ping 10.0.2.2 -n 20 && A:\finish.exe 10.0.2.2"
client/tests/kvm/unattended/win2008-32-autounattend.xml +4 -0
index b8f3a56..0498e99 100644
@@ -113,6 +113,10 @@
                  </SynchronousCommand>
                  <SynchronousCommand wcm:action="add">
                     <Order>5</Order>
+                    <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
+                 </SynchronousCommand>
+                 <SynchronousCommand wcm:action="add">
+                    <Order>6</Order>
                     <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" static 10.0.2.15 255.255.255.0 10.0.2.2 1 &#38;&#38; ping 10.0.2.2 -n 20 &#38;&#38; A:\finish.exe 10.0.2.2</CommandLine>
                  </SynchronousCommand>
             </FirstLogonCommands>
client/tests/kvm/unattended/win2008-64-autounattend.xml +7 -3
index 345165a..77c4999 100644
@@ -120,14 +120,18 @@
                 </SynchronousCommand>
                 <SynchronousCommand wcm:action="add">
                     <Order>5</Order>
+                    <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
+                </SynchronousCommand>
+                <SynchronousCommand wcm:action="add">
+                    <Order>6</Order>
                     <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" static 10.0.2.15 255.255.255.0 10.0.2.2 1 &#38;&#38; ping 10.0.2.2 -n 20 &#38;&#38; A:\finish.exe 10.0.2.2</CommandLine>
                 </SynchronousCommand>
             </FirstLogonCommands>
             <OOBE>
                 <HideEULAPage>true</HideEULAPage>
-		<NetworkLocation>Work</NetworkLocation>
-		<ProtectYourPC>1</ProtectYourPC>
-		<SkipUserOOBE>true</SkipUserOOBE>
+                <NetworkLocation>Work</NetworkLocation>
+                <ProtectYourPC>1</ProtectYourPC>
+                <SkipUserOOBE>true</SkipUserOOBE>
                 <SkipMachineOOBE>true</SkipMachineOOBE>
             </OOBE>
         </component>
client/tests/kvm/unattended/win2008-r2-autounattend.xml +7 -3
index 345165a..77c4999 100644
@@ -120,14 +120,18 @@
                 </SynchronousCommand>
                 <SynchronousCommand wcm:action="add">
                     <Order>5</Order>
+                    <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
+                </SynchronousCommand>
+                <SynchronousCommand wcm:action="add">
+                    <Order>6</Order>
                     <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" static 10.0.2.15 255.255.255.0 10.0.2.2 1 &#38;&#38; ping 10.0.2.2 -n 20 &#38;&#38; A:\finish.exe 10.0.2.2</CommandLine>
                 </SynchronousCommand>
             </FirstLogonCommands>
             <OOBE>
                 <HideEULAPage>true</HideEULAPage>
-		<NetworkLocation>Work</NetworkLocation>
-		<ProtectYourPC>1</ProtectYourPC>
-		<SkipUserOOBE>true</SkipUserOOBE>
+                <NetworkLocation>Work</NetworkLocation>
+                <ProtectYourPC>1</ProtectYourPC>
+                <SkipUserOOBE>true</SkipUserOOBE>
                 <SkipMachineOOBE>true</SkipMachineOOBE>
             </OOBE>
         </component>
client/tests/kvm/unattended/win7-32-autounattend.xml +7 -3
index faf588a..86a0ae7 100644
@@ -58,7 +58,7 @@
                 </ProductKey>
                 <AcceptEula>true</AcceptEula>
                 <FullName>redhatqe</FullName>
-                <Organization>redhat</Organization>                
+                <Organization>redhat</Organization>
             </UserData>
             <EnableFirewall>false</EnableFirewall>
             <EnableNetwork>true</EnableNetwork>
@@ -113,6 +113,10 @@
                  </SynchronousCommand>
                  <SynchronousCommand wcm:action="add">
                     <Order>5</Order>
+                    <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
+                 </SynchronousCommand>
+                 <SynchronousCommand wcm:action="add">
+                    <Order>6</Order>
                     <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" static 10.0.2.15 255.255.255.0 10.0.2.2 1 &#38;&#38; ping 10.0.2.2 -n 20 &#38;&#38; A:\finish.exe 10.0.2.2</CommandLine>
                  </SynchronousCommand>
             </FirstLogonCommands>
@@ -129,8 +133,8 @@
         <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
             <AutoLogon>
                 <Password>
-                    <Value>cgBlAGQAaABhAHQAUABhAHMAcwB3AG8AcgBkAA==</Value>
-                    <PlainText>false</PlainText>
+                    <Value>1q2w3eP</Value>
+                    <PlainText>true</PlainText>
                 </Password>
                 <Username>Administrator</Username>
                 <LogonCount>5</LogonCount>
client/tests/kvm/unattended/win7-64-autounattend.xml +7 -3
index 345165a..77c4999 100644
@@ -120,14 +120,18 @@
                 </SynchronousCommand>
                 <SynchronousCommand wcm:action="add">
                     <Order>5</Order>
+                    <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
+                </SynchronousCommand>
+                <SynchronousCommand wcm:action="add">
+                    <Order>6</Order>
                     <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" static 10.0.2.15 255.255.255.0 10.0.2.2 1 &#38;&#38; ping 10.0.2.2 -n 20 &#38;&#38; A:\finish.exe 10.0.2.2</CommandLine>
                 </SynchronousCommand>
             </FirstLogonCommands>
             <OOBE>
                 <HideEULAPage>true</HideEULAPage>
-		<NetworkLocation>Work</NetworkLocation>
-		<ProtectYourPC>1</ProtectYourPC>
-		<SkipUserOOBE>true</SkipUserOOBE>
+                <NetworkLocation>Work</NetworkLocation>
+                <ProtectYourPC>1</ProtectYourPC>
+                <SkipUserOOBE>true</SkipUserOOBE>
                 <SkipMachineOOBE>true</SkipMachineOOBE>
             </OOBE>
         </component>
client/tests/kvm/unattended/winvista-32-autounattend.xml +10 -6
index 054926d..072385d 100644
@@ -88,20 +88,20 @@
             <UserAccounts>
                 <AdministratorPassword>
                     <!-- <Value>UABAAHMAcwB3ADAAcgBkAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==</Value> -->
-                    <Value>123456</Value>
+                    <Value>1q2w3eP</Value>
                     <PlainText>true</PlainText>
                 </AdministratorPassword>
             </UserAccounts>
             <OOBE>
                 <HideEULAPage>true</HideEULAPage>
-		<NetworkLocation>Work</NetworkLocation>
-		<ProtectYourPC>1</ProtectYourPC>
-		<SkipUserOOBE>true</SkipUserOOBE>
+                <NetworkLocation>Work</NetworkLocation>
+                <ProtectYourPC>1</ProtectYourPC>
+                <SkipUserOOBE>true</SkipUserOOBE>
                 <SkipMachineOOBE>true</SkipMachineOOBE>
             </OOBE>    
             <AutoLogon>
                 <Password>
-                    <Value>123456</Value>
+                    <Value>1q2w3eP</Value>
                     <PlainText>true</PlainText>
                 </Password>
                 <Enabled>true</Enabled>
@@ -126,9 +126,13 @@
                     <Order>4</Order>
                 </SynchronousCommand>
                 <SynchronousCommand wcm:action="add">
-                    <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" static 10.0.2.15 255.255.255.0 10.0.2.2 1 &#38;&#38; ping 10.0.2.2 -n 20 &#38;&#38; A:\finish.exe 10.0.2.2</CommandLine>
+                    <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
                     <Order>5</Order>
                 </SynchronousCommand>
+                <SynchronousCommand wcm:action="add">
+                    <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" static 10.0.2.15 255.255.255.0 10.0.2.2 1 &#38;&#38; ping 10.0.2.2 -n 20 &#38;&#38; A:\finish.exe 10.0.2.2</CommandLine>
+                    <Order>6</Order>
+                </SynchronousCommand>
             </FirstLogonCommands>
         </component>
     </settings>
client/tests/kvm/unattended/winvista-64-autounattend.xml +2 -2
index bb811dc..7396061 100644
@@ -82,7 +82,7 @@
             <UserAccounts>
                 <AdministratorPassword>
                     <!-- <Value>UABAAHMAcwB3ADAAcgBkAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==</Value> -->
-                    <Value>123456</Value>
+                    <Value>1q2w3eP</Value>
                     <PlainText>true</PlainText>
                 </AdministratorPassword>
             </UserAccounts>
@@ -92,7 +92,7 @@
                 <Username>Administrator</Username>
                 <Password>
                     <!-- <Value>UABAAHMAcwB3ADAAcgBkAFAAYQBzAHMAdwBvAHIAZAA=</Value> -->
-                    <Value>123456</Value>
+                    <Value>1q2w3eP</Value>
                     <PlainText>true</PlainText>
                 </Password>
             </AutoLogon>
client/tests/kvm/unattended/winxp32.sif +3 -2
index 153f499..3e59e6d 100644
@@ -16,7 +16,7 @@
     WaitForReboot=no
 
 [GuiUnattended]
-    AdminPassword="123456"
+    AdminPassword="1q2w3eP"
     EncryptedAdminPassword=NO
     TimeZone=85
     OemSkipWelcome=1
@@ -64,7 +64,8 @@
     BrandIEUsingUnattended=Yes
 
 [GuiRunOnce]
-    Command0="cmd /c A:\finish.exe 10.0.2.2"
+    Command0="cmd /c E:\setuprss.bat"
+    Command1="cmd /c A:\finish.exe 10.0.2.2"
 
 [Display]
     Xresolution=1024
Signature · 1 line
1.6.5.2
#0 lore raw

PATCH 1/2 KVM test: Add a new (optional) extra param to VM, cdrom_extra

In order to support windows install through unattended method (we need to setup rss.exe on the hosts), add an additional (and optional) parameter to tests, cdrom_extra, to make possible to boot a VM with 2 CDs.

---
 client/tests/kvm/kvm_vm.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
client/tests/kvm/kvm_vm.py +9 -1
index ed6d5ad..483204c 100755
@@ -268,7 +268,15 @@ class VM:
         iso = params.get("cdrom")
         if iso:
             iso = kvm_utils.get_path(root_dir, iso)
-            qemu_cmd += " -cdrom %s" % iso
+            qemu_cmd += " -drive file=%s,index=2,media=cdrom" % iso
+
+        # Even though this is not a really scalable approach,
+        # it doesn't seem like we are going to need more than
+        # 2 CDs active on the same VM.
+        iso_extra = params.get("cdrom_extra")
+        if iso_extra:
+            iso_extra = kvm_utils.get_path(root_dir, iso_extra)
+            qemu_cmd += " -drive file=%s,index=3,media=cdrom" % iso_extra
 
         # We may want to add {floppy_otps} parameter for -fda
         # {fat:floppy:}/path/. However vvfat is not usually recommended
Signature · 1 line
1.6.5.2