Skip to content

Commit

Permalink
Reimage Support for Non-Ephemeral VMs (#21090)
Browse files Browse the repository at this point in the history
* Reimage support for non-ephemeral VMs

* small changes

* small changes

* resolving issues

* pretty check

* pretty install

* remove package-lock

* remove package-lock
  • Loading branch information
srcharug authored Dec 15, 2022
1 parent dcec109 commit 2884c0e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"api-version": "2022-11-01",
"vmName": "myVMName",
"parameters": {
"tempDisk": true,
"exactVersion": "aaaaaa",
"osProfile": {
"adminPassword": "{your-password}",
"customData": "{your-custom-data}"
}
}
},
"responses": {
"200": {},
"202": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@
"VirtualMachines"
],
"operationId": "VirtualMachines_Reimage",
"description": "Reimages the virtual machine which has an ephemeral OS disk back to its initial state.",
"description": "Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage.",
"parameters": [
{
"name": "resourceGroupName",
Expand Down Expand Up @@ -1573,6 +1573,9 @@
"x-ms-examples": {
"Reimage a Virtual Machine.": {
"$ref": "./examples/virtualMachineExamples/VirtualMachine_Reimage.json"
},
"Reimage a Non-Ephemeral Virtual Machine.": {
"$ref": "./examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json"
}
}
}
Expand Down Expand Up @@ -2471,10 +2474,33 @@
"tempDisk": {
"type": "boolean",
"description": "Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk."
},
"exactVersion": {
"type": "string",
"description": "Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk is reimaged to the existing version of OS Disk."
},
"osProfile": {
"$ref": "#/definitions/OSProfileProvisioningData",
"description": "Specifies information required for reimaging the non-ephemeral OS disk."
}
},
"description": "Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be reimaged"
},
"OSProfileProvisioningData": {
"type": "object",
"properties": {
"adminPassword": {
"type": "string",
"description": "Specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\\W_]) <br><br> **Disallowed values:** \"abc@123\", \"P@$$w0rd\", \"P@ssw0rd\", \"P@ssword123\", \"Pa$$word\", \"pass@word1\", \"Password!\", \"Password1\", \"Password22\", \"iloveyou!\" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection)",
"x-ms-secret": true
},
"customData": {
"type": "string",
"description": "Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** <br><br> This property cannot be updated after the VM is created. <br><br> customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init)"
}
},
"description": "Additional parameters for Reimaging Non-Ephemeral Virtual Machine."
},
"VirtualMachineCaptureParameters": {
"properties": {
"vhdPrefix": {
Expand Down

0 comments on commit 2884c0e

Please sign in to comment.