Image builder scripts added.
Makefile and files required to build Windows image. Additional information provided via README files. Change-Id: I9e62de6ba643ec3f4fc7c4a7c979c60ccc0e4d8e
This commit is contained in:
parent
fda84a0484
commit
7acaf7d1e9
|
@ -0,0 +1,132 @@
|
|||
|
||||
.PHONY: force clean usage
|
||||
|
||||
|
||||
image_name :=
|
||||
build_root := /opt/image-builder
|
||||
shared_files_dir := ${build_root}/share/files
|
||||
shared_scripts_dir := ${build_root}/share/scripts
|
||||
shared_images_dir := ${build_root}/share/images
|
||||
libvirt_images_dir := ${build_root}/libvirt/images
|
||||
ps_modules_dir := ${CURDIR}/../WindowsPowerShell
|
||||
|
||||
image_list := ws-2008r2-core ws-2012-core
|
||||
|
||||
dirs := ${build_root}
|
||||
dirs += ${libvirt_images_dir}
|
||||
dirs += ${shared_files_dir}
|
||||
dirs += ${shared_scripts_dir}
|
||||
dirs += ${shared_images_dir}
|
||||
|
||||
|
||||
# Static files == files that are not changed from one build to another
|
||||
# Typically it's binary prerequisite files
|
||||
static_files := ${libvirt_images_dir}/ws-2012-eval.iso
|
||||
static_files += ${libvirt_images_dir}/virtio-win-0.1-52.iso
|
||||
static_files += ${shared_files_dir}/CloudbaseInitSetup_Beta.msi
|
||||
static_files += ${shared_files_dir}/Far30b3367.x64.20130426.msi
|
||||
static_files += ${shared_files_dir}/Git-1.8.1.2-preview20130201.exe
|
||||
static_files += ${shared_files_dir}/SysinternalsSuite.zip
|
||||
static_files += ${shared_files_dir}/unzip.exe
|
||||
static_files += ${shared_files_dir}/userdata.py
|
||||
# TODO: move the following files to the 'dynamic files' as they are 'version dependent'
|
||||
static_files += ${shared_files_dir}/MuranoAgent.zip
|
||||
|
||||
|
||||
# Dynamic files == files that might be updated from repository during the build.
|
||||
dynamic_files := ${shared_files_dir}/CoreFunctions.zip
|
||||
|
||||
|
||||
build_files := ${shared_files_dir}/ws-2012-core/autounattend.xml
|
||||
build_files += ${shared_files_dir}/ws-2012-core/unattend.xml
|
||||
build_files += ${build_root}/install-vm.sh
|
||||
build_files += ${shared_scripts_dir}/wpi.ps1
|
||||
#build_files += ${shared_scripts_dir}/Start-Sysprep.ps1
|
||||
|
||||
|
||||
usage :
|
||||
@echo ''
|
||||
@echo 'Available build targets:'
|
||||
@echo '* clean - clean files related to image build process.'
|
||||
@echo '* clean-all - clean all files (including produces by other makefiles).'
|
||||
@echo '* build-root - create directory structure.'
|
||||
@echo '* test-build-files - test if all prerequisites are in place.'
|
||||
@echo ''
|
||||
@echo 'Available image targets:'
|
||||
@for name in ${image_list} ; do \
|
||||
echo "* $$name"; \
|
||||
done
|
||||
@echo ''
|
||||
|
||||
|
||||
clean :
|
||||
-rm -f ${libvirt_images_dir}/*.flp
|
||||
-rm -f ${libvirt_images_dir}/*.qcow2
|
||||
-rm -f ${libvirt_images_dir}/*.img
|
||||
|
||||
|
||||
clean-all : clean
|
||||
${MAKE} -C ${ps_modules_dir} clean
|
||||
|
||||
|
||||
build-root : ${dirs}
|
||||
cp -r * ${build_root}
|
||||
|
||||
|
||||
${dirs} :
|
||||
mkdir -p $@
|
||||
|
||||
|
||||
test-build-files : ${build_files} ${static_files} ${dynamic_files}
|
||||
|
||||
|
||||
# Rule to check if all 'static files' are in place
|
||||
${static_files} :
|
||||
@[ -f $@ ] || echo "STOP: File not found '$@'"; exit 1
|
||||
|
||||
|
||||
# Rule to copy updated 'build files'
|
||||
${build_files} : ${build_root}/% : ${CURDIR}/%
|
||||
cp $< $@
|
||||
|
||||
|
||||
# Rules for 'dynamic files'
|
||||
#----------
|
||||
${shared_files_dir}/CoreFunctions.zip : ${ps_modules_dir}/CoreFunctions.zip
|
||||
|
||||
|
||||
${ps_modules_dir}/CoreFunctions.zip :
|
||||
${MAKE} -C ${ps_modules_dir} all
|
||||
cp $@ ${shared_files_dir}/$(F@)
|
||||
#----------
|
||||
|
||||
|
||||
ifndef image_name
|
||||
|
||||
${image_list} :
|
||||
@echo "Image name: '$@'"
|
||||
@echo "Starting make recurcievely ..."
|
||||
${MAKE} -e image_name=$@ $@
|
||||
|
||||
else
|
||||
|
||||
${image_name} : ${shared_images_dir}/${image_name}.qcow2
|
||||
|
||||
|
||||
${shared_images_dir}/${image_name}.qcow2 : test-build-files ${libvirt_images_dir}/${image_name}.flp
|
||||
env BUILD_ROOT=${build_root} VM_NAME=${image_name} FLOPPY_IMG=${image_name}.flp ${build_root}/install-vm.sh
|
||||
|
||||
|
||||
${libvirt_images_dir}/${image_name}.flp : ${shared_files_dir}/${image_name}/autounattend.xml
|
||||
dd bs=512 count=2880 if=/dev/zero of=${libvirt_images_dir}/${image_name}.flp
|
||||
mkfs.msdos ${libvirt_images_dir}/${image_name}.flp
|
||||
-mkdir -p /media/floppy/
|
||||
mount -o loop ${libvirt_images_dir}/${image_name}.flp /media/floppy/
|
||||
cp ${shared_files_dir}/${image_name}/autounattend.xml /media/floppy/autounattend.xml
|
||||
umount /media/floppy
|
||||
|
||||
|
||||
${shared_files_dir}/${image_name}/autounattend.xml : ;
|
||||
|
||||
endif
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
Image builder
|
||||
=============
|
||||
|
||||
Use the 'make' utility to start build new Windows image.
|
||||
|
||||
During build preparation this folder will be copied entirely to the **/opt/image-builder** folder. We refer to that folder using variable **BUILD_ROOT**.
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
The following ISO files **MUST** be placed under **$BUILD_ROOT/libvirt/images** folder:
|
||||
* ws-2012-eval.iso - Windows installation ISO file. Must be renamed or simlinked.
|
||||
* virtio-win-0.1-52.iso - VirtIO drivers for Windows.
|
||||
|
||||
Files that **MUST** be placed under **$BUILD_ROOT/share/files** are described in README file under **share/files** subfolder.
|
||||
|
||||
Required steps
|
||||
--------------
|
||||
|
||||
1. Run **make build-root** to create directory structure. It will be built under '/opt/image-builder' folder, which is internally referred by **BUILD_ROOT** variable.
|
||||
2. Copy prerequisite files to their folders.
|
||||
3. Run **make test-build-files** to ensure that all files are in place.
|
||||
4. Run **make** to show available image targets.
|
||||
5. Run **make <image target>** to build image.
|
||||
6. Image file should be saved under **$BUILD_ROOT/libvirt/images** folder.
|
||||
|
||||
* Run **make clean** to remove files produced by this makefile only. NOTE: 'static files' (prerequisites) will be kept.
|
||||
* Run **make clean-all** to run clean other files, that were prodiced by other makefiles.
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
#!/bin/sh
|
||||
# automation job script
|
||||
|
||||
|
||||
# Variables below may be changed thru 'env' command when script called like
|
||||
# env BUILD_ROOT=/opt install-vm.sh
|
||||
# PLEASE BE CAREFUL RENAMING THEM!
|
||||
BUILD_ROOT=${BUILD_ROOT:='/opt/build-system'}
|
||||
VM_NAME=${VM_NAME:='WinServ2k12-custom'}-REF
|
||||
VM_IMG_SIZE='40G'
|
||||
BOOT_ISO=${BOOT_ISO:='ws-2012-eval.iso'}
|
||||
VIRTIO_ISO=${VIRTIO_ISO:='virtio-win-0.1-52.iso'}
|
||||
FLOPPY_IMG=${FLOPPY_IMG:='floppy.img'}
|
||||
|
||||
# Other variables
|
||||
LIBVIRT_IMAGES_DIR=$BUILD_ROOT/libvirt/images
|
||||
HDD_IMG_NAME="$VM_NAME.img"
|
||||
VM_IMG_PATH="$LIBVIRT_IMAGES_DIR/$HDD_IMG_NAME"
|
||||
VM_REF_IMG_PATH="$BUILD_ROOT/share/images/ws-2012-core.qcow2"
|
||||
|
||||
|
||||
|
||||
# Functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
die() {
|
||||
echo ''
|
||||
echo "STOP: $@"
|
||||
echo '*** SCRIPT FAILED ***'
|
||||
echo ''
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
prealloc_img() {
|
||||
echo ''
|
||||
echo '-> Allocating new image file for VM ...'
|
||||
echo "* Image file: '$VM_IMG_PATH', requested size: '$VM_IMG_SIZE'"
|
||||
qemu-img create -f raw $VM_IMG_PATH $VM_IMG_SIZE \
|
||||
|| die "Command 'qemu-img create' failed."
|
||||
echo '<- done'
|
||||
}
|
||||
|
||||
|
||||
compress_and_transfer_ready_img() {
|
||||
echo ''
|
||||
echo '-> Converting VM image to QCOW2 format ...'
|
||||
echo "* Compressing QCOW2 image ('$VM_IMG_PATH' --> '$VM_REF_IMG_PATH') ..."
|
||||
qemu-img convert -O qcow2 $VM_IMG_PATH $VM_REF_IMG_PATH \
|
||||
|| die "Command 'qemu-img convert' failed."
|
||||
echo '<- done'
|
||||
}
|
||||
|
||||
|
||||
start_vm_install() {
|
||||
echo ''
|
||||
echo '-> Starting VM ...'
|
||||
virt-install --connect qemu:///system \
|
||||
--hvm \
|
||||
--name $VM_NAME \
|
||||
--ram 2048 \
|
||||
--vcpus 2 \
|
||||
--cdrom $LIBVIRT_IMAGES_DIR/$BOOT_ISO \
|
||||
--disk path=$LIBVIRT_IMAGES_DIR/$VIRTIO_ISO,device=cdrom \
|
||||
--disk path=$LIBVIRT_IMAGES_DIR/$FLOPPY_IMG,device=floppy \
|
||||
--disk path=$VM_IMG_PATH,format=raw,bus=virtio,io=native,cache=none \
|
||||
--network network=default,model=virtio \
|
||||
--vnc \
|
||||
--os-type=windows \
|
||||
--os-variant=win2k8 \
|
||||
--noautoconsole \
|
||||
--accelerate \
|
||||
--noapic \
|
||||
--keymap=en-us \
|
||||
--video=cirrus \
|
||||
--force
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
die "virt-install for VM '$VM_NAME' failed."
|
||||
fi
|
||||
|
||||
# waiting for autounuttended setup completes
|
||||
while true
|
||||
do
|
||||
DOM_STATE=$(get_domain_state $VM_NAME)
|
||||
if [ "$DOM_STATE" = 'shut off' ]; then
|
||||
break
|
||||
else
|
||||
echo "* Domain $VM_NAME still running"
|
||||
sleep 60
|
||||
fi
|
||||
done
|
||||
|
||||
echo '<- done'
|
||||
}
|
||||
|
||||
|
||||
delete_vm() {
|
||||
echo ''
|
||||
echo '-> Deleting VM ...'
|
||||
#virsh undefine $VM_NAME --storage $VM_IMG_PATH
|
||||
virsh undefine $VM_NAME || die "Unable to undefine VM '$VM_NAME'."
|
||||
#virsh vol-delete $VM_IMG_PATH || die "Unable to delete volume '$VM_IMG_PATH'."
|
||||
echo '<- done'
|
||||
}
|
||||
|
||||
|
||||
|
||||
get_domain_state() {
|
||||
local domain_name
|
||||
local domain_state
|
||||
|
||||
domain_name=$1
|
||||
domain_state=$(virsh domstate $domain_name)
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo ''
|
||||
fi
|
||||
echo $domain_state
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
# Workflow steps below
|
||||
#------------------------------------------------------------------------------
|
||||
# Check if guest vm with same name exists and not running
|
||||
#-----
|
||||
DOM_STATE=$(get_domain_state $VM_NAME)
|
||||
|
||||
if [ -z "$DOM_STATE" ]; then
|
||||
echo "Domain '$VM_NAME' not exist."
|
||||
else
|
||||
if [ "$DOM_STATE" != 'shut off' ]; then
|
||||
die "Guest '$VM_NAME' exists and in state '$DOM_STATE'."
|
||||
fi
|
||||
|
||||
echo ''
|
||||
echo "Guest '$VM_NAME' exists, shut off and will be deleted."
|
||||
delete_vm
|
||||
fi
|
||||
#-----
|
||||
|
||||
|
||||
# Preallocate guest vm disk image
|
||||
#-----
|
||||
prealloc_img
|
||||
#-----
|
||||
|
||||
|
||||
# Start guest vm installation
|
||||
#-----
|
||||
start_vm_install
|
||||
#-----
|
||||
|
||||
|
||||
# Compress and copy redy image
|
||||
#-----
|
||||
compress_and_transfer_ready_img
|
||||
#-----
|
||||
|
||||
|
||||
# Delete vm
|
||||
#-----
|
||||
#delete_vm
|
||||
#-----
|
||||
|
||||
|
||||
echo ''
|
||||
echo "Work done, reference system image path is '$VM_REF_IMG_PATH'."
|
||||
echo ''
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
This folder is intended to hold files that will be used during image build process.
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
Prerequisite files
|
||||
==================
|
||||
|
||||
This folder contains files, required to build Windows image.
|
||||
|
||||
Subfolders hold files that are depend on Windows version.
|
||||
|
||||
Cloned from Git repo this folder will contain only the following files:
|
||||
* userdata.py
|
||||
|
||||
The following files **MUST** be added to the folder **$BUILD_ROOT/image-builder/share/files** by hands.
|
||||
* CloudbaseInitSetup_Beta.msi
|
||||
* Far30b3367.x64.20130426.msi
|
||||
* SysinternalsSuite.zip
|
||||
* Git-1.8.1.2-preview20130201.exe
|
||||
* unzip.exe
|
||||
|
||||
The following files will be build by other makefiles:
|
||||
* CoreFunctions.zip
|
||||
|
||||
The following files should be also added to the folder **$BUILD_ROOT/image-builder/share/files**, but in future they might also be built automatically:
|
||||
* MuranoAgent.zip
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2012 Cloudbase Solutions Srl
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import re
|
||||
import tempfile
|
||||
import uuid
|
||||
import email
|
||||
import tempfile
|
||||
import os
|
||||
import errno
|
||||
|
||||
from cloudbaseinit.openstack.common import cfg
|
||||
from cloudbaseinit.openstack.common import log as logging
|
||||
from cloudbaseinit.osutils.factory import *
|
||||
from cloudbaseinit.plugins.base import *
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
opts = [
|
||||
cfg.StrOpt('user_data_folder', default='cloud-data',
|
||||
help='Specifies a folder to store multipart data files.'),
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(opts)
|
||||
|
||||
class UserDataPlugin():
|
||||
def __init__(self, cfg=CONF):
|
||||
self.cfg = cfg
|
||||
self.msg = None
|
||||
return
|
||||
|
||||
def execute(self, service):
|
||||
user_data = service.get_user_data('openstack')
|
||||
if not user_data:
|
||||
return False
|
||||
|
||||
LOG.debug('User data content:\n%s' % user_data)
|
||||
|
||||
if user_data.startswith('Content-Type: multipart'):
|
||||
for part in self.parse_MIME(user_data):
|
||||
self.process_part(part)
|
||||
else:
|
||||
self.handle(user_data)
|
||||
return
|
||||
|
||||
def process_part(self, part):
|
||||
if part.get_filename() == 'cfn-userdata':
|
||||
self.handle(part.get_payload())
|
||||
return
|
||||
|
||||
def parse_MIME(self, user_data):
|
||||
folder = self.cfg.user_data_folder
|
||||
self.create_folder(folder)
|
||||
|
||||
self.msg = email.message_from_string(user_data)
|
||||
return self.msg.walk()
|
||||
|
||||
|
||||
def create_folder(self, folder):
|
||||
try:
|
||||
os.mkdir(folder)
|
||||
except os.OSError, e:
|
||||
if e.errno != errno.EEXIST:
|
||||
raise e
|
||||
return
|
||||
|
||||
def handle(self, user_data):
|
||||
|
||||
osutils = OSUtilsFactory().get_os_utils()
|
||||
|
||||
target_path = os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))
|
||||
if re.search(r'^rem cmd\s', user_data, re.I):
|
||||
target_path += '.cmd'
|
||||
args = [target_path]
|
||||
shell = True
|
||||
elif re.search(r'^#!', user_data, re.I):
|
||||
target_path += '.sh'
|
||||
args = ['bash.exe', target_path]
|
||||
shell = False
|
||||
elif re.search(r'^#ps1\s', user_data, re.I):
|
||||
target_path += '.ps1'
|
||||
args = ['powershell.exe', '-ExecutionPolicy', 'RemoteSigned',
|
||||
'-NonInteractive', target_path]
|
||||
shell = False
|
||||
else:
|
||||
# Unsupported
|
||||
LOG.warning('Unsupported user_data format')
|
||||
return False
|
||||
|
||||
try:
|
||||
with open(target_path, 'wb') as f:
|
||||
f.write(user_data)
|
||||
(out, err, ret_val) = osutils.execute_process(args, shell)
|
||||
|
||||
LOG.info('User_data script ended with return code: %d' % ret_val)
|
||||
LOG.debug('User_data stdout:\n%s' % out)
|
||||
LOG.debug('User_data stderr:\n%s' % err)
|
||||
except Exception, ex:
|
||||
LOG.warning('An error occurred during user_data execution: \'%s\'' % ex)
|
||||
finally:
|
||||
if os.path.exists(target_path):
|
||||
os.remove(target_path)
|
||||
|
||||
return False
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
Files for Windows Server 2008 R2 Core only
|
||||
==========================================
|
||||
|
||||
This folder contains files that are required to build Windows Server 2008 R2 Core version:
|
||||
* autounattend.xml - answer file to start unattended installation.
|
||||
* unattend.xml - answer file to be used with Sysprep utility.
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
Files for Windows Server 2012 Core only
|
||||
=======================================
|
||||
|
||||
This folder contains files that are required to build Windows Server 2012 Core version:
|
||||
* autounattend.xml - answer file to start unattended installation.
|
||||
* unattend.xml - answer file to be used with Sysprep utility.
|
||||
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="windowsPE">
|
||||
<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>
|
||||
<InputLocale>en-US</InputLocale>
|
||||
<SystemLocale>en-US</SystemLocale>
|
||||
<UILanguage>en-US</UILanguage>
|
||||
<UserLocale>en-US</UserLocale>
|
||||
</component>
|
||||
<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">
|
||||
<DiskConfiguration>
|
||||
<Disk wcm:action="add">
|
||||
<CreatePartitions>
|
||||
<CreatePartition wcm:action="add">
|
||||
<Order>1</Order>
|
||||
<Size>350</Size>
|
||||
<Type>Primary</Type>
|
||||
</CreatePartition>
|
||||
<CreatePartition wcm:action="add">
|
||||
<Extend>true</Extend>
|
||||
<Order>2</Order>
|
||||
<Type>Primary</Type>
|
||||
</CreatePartition>
|
||||
</CreatePartitions>
|
||||
<ModifyPartitions>
|
||||
<ModifyPartition wcm:action="add">
|
||||
<Active>true</Active>
|
||||
<Label>System</Label>
|
||||
<Format>NTFS</Format>
|
||||
<Order>1</Order>
|
||||
<PartitionID>1</PartitionID>
|
||||
</ModifyPartition>
|
||||
<ModifyPartition wcm:action="add">
|
||||
<Format>NTFS</Format>
|
||||
<Label>Windows</Label>
|
||||
<Order>2</Order>
|
||||
<PartitionID>2</PartitionID>
|
||||
<Letter>C</Letter>
|
||||
</ModifyPartition>
|
||||
</ModifyPartitions>
|
||||
<DiskID>0</DiskID>
|
||||
<WillWipeDisk>true</WillWipeDisk>
|
||||
</Disk>
|
||||
<WillShowUI>OnError</WillShowUI>
|
||||
</DiskConfiguration>
|
||||
<ImageInstall>
|
||||
<OSImage>
|
||||
<InstallFrom>
|
||||
<MetaData wcm:action="add">
|
||||
<Key>/IMAGE/INDEX</Key>
|
||||
<Value>2</Value>
|
||||
</MetaData>
|
||||
</InstallFrom>
|
||||
<InstallToAvailablePartition>false</InstallToAvailablePartition>
|
||||
<WillShowUI>OnError</WillShowUI>
|
||||
<InstallTo>
|
||||
<DiskID>0</DiskID>
|
||||
<PartitionID>2</PartitionID>
|
||||
</InstallTo>
|
||||
</OSImage>
|
||||
</ImageInstall>
|
||||
<UserData>
|
||||
<AcceptEula>true</AcceptEula>
|
||||
<FullName>User</FullName>
|
||||
<Organization>Stack</Organization>
|
||||
</UserData>
|
||||
<EnableNetwork>true</EnableNetwork>
|
||||
<LogPath>A:\</LogPath>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-PnpCustomizationsWinPE" 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">
|
||||
<DriverPaths>
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="1">
|
||||
<Path>E:\WIN8\AMD64\</Path>
|
||||
</PathAndCredentials>
|
||||
</DriverPaths>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="oobeSystem">
|
||||
<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">
|
||||
<AutoLogon>
|
||||
<Enabled>true</Enabled>
|
||||
<LogonCount>9</LogonCount>
|
||||
<Username>administrator</Username>
|
||||
<Password>
|
||||
<Value>UABhAHMAcwB3AG8AcgBkADEAUABhAHMAcwB3AG8AcgBkAA==</Value>
|
||||
<PlainText>false</PlainText>
|
||||
</Password>
|
||||
</AutoLogon>
|
||||
<UserAccounts>
|
||||
<AdministratorPassword>
|
||||
<Value>UABhAHMAcwB3AG8AcgBkADEAQQBkAG0AaQBuAGkAcwB0AHIAYQB0AG8AcgBQAGEAcwBzAHcAbwByAGQA</Value>
|
||||
<PlainText>false</PlainText>
|
||||
</AdministratorPassword>
|
||||
</UserAccounts>
|
||||
<RegisteredOrganization>Company</RegisteredOrganization>
|
||||
<RegisteredOwner>Windows User</RegisteredOwner>
|
||||
<TimeZone>Russian Standard Time</TimeZone>
|
||||
<FirstLogonCommands>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>1</Order>
|
||||
<RequiresUserInput>false</RequiresUserInput>
|
||||
<Description>FirstCommand</Description>
|
||||
<CommandLine>%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe Set-ExecutionPolicy Unrestricted -force</CommandLine>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>2</Order>
|
||||
<CommandLine>%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe Import-Module ServerManager; Install-WindowsFeature NET-Framework-Core –Source D:\Sources\SxS</CommandLine>
|
||||
<Description>Add dot Net 3.5 feature</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>3</Order>
|
||||
<CommandLine>%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe New-Item -Path $env:systemdrive'\Murano' -Type Container;</CommandLine>
|
||||
<Description>Creating Murano folder in the sytem drive root</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>4</Order>
|
||||
<CommandLine>%WINDIR%\System32\net.exe use m: \\192.168.122.1\share\MRN</CommandLine>
|
||||
<Description>Mounting network share from HOST</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>5</Order>
|
||||
<CommandLine>%WINDIR%\System32\xcopy.exe m:\Files %HOMEDRIVE%\Murano\Files /s /i /y /q</CommandLine>
|
||||
<Description>Copying content to local folder</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>6</Order>
|
||||
<CommandLine>%WINDIR%\System32\xcopy.exe m:\Scripts %HOMEDRIVE%\Murano\Scripts /s /i /y /q</CommandLine>
|
||||
<Description>Copying content to local folder</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>8</Order>
|
||||
<CommandLine>%WINDIR%\System32\net.exe use m: /delete /y</CommandLine>
|
||||
<Description>Unmounting network share</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>7</Order>
|
||||
<Description>Windows post install process with sysprep</Description>
|
||||
<CommandLine>%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe -Command "Start-Sleep -s 2; & %SYSTEMDRIVE%\murano\scripts\wpi.ps1"</CommandLine>
|
||||
</SynchronousCommand>
|
||||
</FirstLogonCommands>
|
||||
</component>
|
||||
</settings>
|
||||
<cpi:offlineImage cpi:source="catalog:c:/users/iyozhikov/documents/install_windows server 2012 serverstandard.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
|
||||
</unattend>
|
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="specialize">
|
||||
<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">
|
||||
<TimeZone>Pacific Stantard Time</TimeZone>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="oobeSystem">
|
||||
<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">
|
||||
<AutoLogon>
|
||||
<Password>
|
||||
<Value>UABAAHMAcwB3ADAAcgBkAFAAYQBzAHMAdwBvAHIAZAA=</Value>
|
||||
<PlainText>false</PlainText>
|
||||
</Password>
|
||||
<LogonCount>1</LogonCount>
|
||||
<Username>Administrator</Username>
|
||||
<Enabled>true</Enabled>
|
||||
</AutoLogon>
|
||||
<UserAccounts>
|
||||
<AdministratorPassword>
|
||||
<Value>UABAAHMAcwB3ADAAcgBkAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==</Value>
|
||||
<PlainText>false</PlainText>
|
||||
</AdministratorPassword>
|
||||
</UserAccounts>
|
||||
<RegisteredOrganization>-</RegisteredOrganization>
|
||||
<RegisteredOwner>-</RegisteredOwner>
|
||||
<OOBE>
|
||||
<HideEULAPage>true</HideEULAPage>
|
||||
</OOBE>
|
||||
<FirstLogonCommands>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
<CommandLine>powershell.exe Get-Date</CommandLine>
|
||||
<Order>1</Order>
|
||||
</SynchronousCommand>
|
||||
</FirstLogonCommands>
|
||||
</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">
|
||||
<InputLocale>en-US</InputLocale>
|
||||
<SystemLocale>en-US</SystemLocale>
|
||||
<UILanguage>en-US</UILanguage>
|
||||
<UserLocale>en-US</UserLocale>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="generalize">
|
||||
<component name="Microsoft-Windows-Security-SPP" 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">
|
||||
<SkipRearm>1</SkipRearm>
|
||||
</component>
|
||||
</settings>
|
||||
<cpi:offlineImage cpi:source="wim:d:/aik/install.wim#Windows Server 2012 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
|
||||
</unattend>
|
|
@ -0,0 +1,5 @@
|
|||
Scripts to build Windows image
|
||||
==============================
|
||||
|
||||
This folder contains files that are executed on Windows system being built.
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue