2017年6月4日 星期日

Create a template VM and Create a new VM from template VM 建立範本虛擬機器,透過範本虛擬機器來建立新的虛擬機器

Create a template VM and Create a new VM from template VM
建立範本虛擬機器,透過範本虛擬機器來建立新的虛擬機器

1.Create a template VM (建立一個範本VM)
Install guest OS, enable roles and features and then apply the needed Windows patches and hotfix.
2.Run SYSPREP (執行Sysprep工具)
Login VM, then run SYSPREP
%windir%\system32\sysprep\sysprep.exe
(Enter system out-of-box experience, enable generalize, shutdown option: shutdown)

Sysprep (System Preparation) Overview
3.export the template VM(匯出將範本VM)
匯出範本VM到指定的目錄。
PS.匯出後此範本VM可以刪除。
4.Create a new VM from template VM. (從範本VM來建立一個新的VM)
(1)copy the VHD(virtual hard drive) file from exported VM folder to new VM Folder.
到匯出的VM目錄下將VHD檔案複製出來。
(2)Create a new VM per the usual steps and attach the copied VHD(x) to it.
select [Use an exist virtual disk] or [Attach a virtual virtual disk]
建立新的VM時,選擇使用已經存在的虛擬磁碟,也就是剛剛複製出來的VHD檔

差異虛擬磁碟: Differencing Disks
如果想節省磁碟空間,可以使用差異虛擬磁碟
透過一個父系磁碟來建置許多個不同的差異磁碟
(注意:父系磁碟在建立後就不能作變更及開啟使用,否則連結在父系磁碟的差異磁碟運作會異常)
此功能如同VMware workstation的 link to Clone VM
設定方法,參考下面這篇
Reference:
How to create a Hyper-V VM template
https://hyperv.veeam.com/blog/how-to-create-hyper-v-vm-template/

沒有留言:

SQL Server Database Mirroring 資料庫鏡像

SQL Server Database Mirroring 資料庫鏡像