Tag: Cloud Platform for Cloud computing
You first create a VM virtual machine in the usual way, but the virtual machine that made the template must be a managed disk
Then sign in to configure
In the virtual machine I installed the IIS service and referenced the practice of Azure file (file sharing)-nas, I let this IIS connect to my Azure shared storage and provide Web services
The system then needs to be Sysprep-generalized: Sysprep deletes all personal account information and some other data, and is ready to be used as an image and which will not be cleaned by Sysprep. Refer to: https://docs.microsoft.com/en-us/ previous-versions/windows/it-pro/windows-7/dd744581 (v=ws.10)
Open the Command Prompt window as an administrator. Switch the directory to%windir%\system32\sysprep, and then run Sysprep.exe
The system shuts down automatically when the patient waits to complete
The virtual machine stopped, but the resource was not released
Then run PowerShell as an administrator, sign in to your azure, and view the VM information
Get-azurermvm
First execute the following command to release the resource deallocation
Stop-azurermvm-resourcegroupname Serversresourcegroup-name Webtemp-force
Then set the virtual machine to a common state
Set-azurermvm-resourcegroupname Serversresourcegroup-name webtemp-generalized
You can then start creating the mirror template, first set up a variable to get the virtual machine
$VM = Get-azurermvm-name Webtemp-resourcegroupname serversresourcegroup
To create a mirrored configuration variable
$image = New-azurermimageconfig-location Eastasia-sourcevirtualmachineid $vm. ID
Finally create the image, the name of the image I created is Webtempos
New-azurermimage-image $image-imagename webtempos-resourcegroupname serversresourcegroup
If you want to view all the mirror templates you can do the following:
$images = Find-azurermresource-resourcetype Microsoft.compute/images
$images. Name
If you want to create a virtual machine based on this image template, you can create it from here
Once created, only the FILEDISK01 account of the Computer Management user and the AZURESHAREFILE01 ID (filedisk01) in the application pool in IIS and the password for the site connection for the account filedisk01 I updated it manually. You can see that the FILEDISK01 account that was defined before the virtual machine created by the template is still there, and IIS is still there, both the application pool and the site.
If you want to delete a mirror, such as removing a mirror template named Webtempos from the Serversresourcegroup resource group
Remove-azurermimage-imagename Webtempos-resourcegroupname Serversresourcegroup
In fact, the main focus is on how to create a custom image of a Windows system, and how to implement a crafted image that automatically configures IIS at deployment time and connects to a backend database or file to provide front-end access I just played a role in introducing You can customize the perfect image that truly meets your needs, based on your actual business needs.
36.Azure making a custom Windows virtual machine image