Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable trusted launch for existing-WVD-host-pool-arm #656

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,27 @@
"description": "System data is used for internal purposes, such as support preview features."
},
"defaultValue": {}
},
"securityType": {
Copy link
Member

@lintFan lintFan Nov 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the only valid value for this is an empty string or TrustedLaunch then you should specify "allowedValues" with those values so the customer will get an error if they enter something else.
This applies to the other ARM templates in this PR too.

"type": "string",
"metadata": {
"description": "Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings. Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be helpful to include a link to the docs for this here https://docs.microsoft.com/en-us/azure/templates/microsoft.compute/2021-07-01/virtualmachines?tabs=bicep#securityprofile so the customer has more context about this.

},
"defaultValue": ""
},
"secureBoot": {
"type": "bool",
"metadata": {
"description": "Specifies whether secure boot should be enabled on the virtual machine."
Copy link
Member

@lintFan lintFan Nov 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should say this is only used if securityType is set to "TrustedLaunch".
This applies to the other ARM templates in this PR too.

},
"defaultValue": false
},
"vTPM": {
"type": "bool",
"metadata": {
"description": "Specifies whether vTPM (Virtual Trusted Platform Module) should be enabled on the virtual machine."
Copy link
Member

@lintFan lintFan Nov 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should say this is only used if securityType is set to "TrustedLaunch".
This applies to the other ARM templates in this PR too.

},
"defaultValue": false
}
},
"variables": {
Expand Down Expand Up @@ -634,6 +655,15 @@
},
"SessionHostConfigurationVersion": {
"value": "[if(contains(parameters('systemData'), 'hostpoolUpdate'), parameters('systemData').sessionHostConfigurationVersion, '')]"
},
"securityType": {
"value": "[parameters('securityType')]"
},
"secureBoot": {
"value": "[parameters('secureBoot')]"
},
"vTPM": {
"value": "[parameters('vTPM')]"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,27 @@
"description": "System data is used for internal purposes, such as support preview features."
},
"defaultValue": {}
},
"securityType": {
"type": "string",
"metadata": {
"description": "Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings. Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch."
},
"defaultValue": ""
},
"secureBoot": {
"type": "bool",
"metadata": {
"description": "Specifies whether secure boot should be enabled on the virtual machine."
},
"defaultValue": false
},
"vTPM": {
"type": "bool",
"metadata": {
"description": "Specifies whether vTPM (Virtual Trusted Platform Module) should be enabled on the virtual machine."
},
"defaultValue": false
}
},
"variables": {
Expand Down Expand Up @@ -947,6 +968,15 @@
},
"SessionHostConfigurationVersion": {
"value": "[if(and(variables('createVMs'), contains(parameters('systemData'), 'hostpoolUpdateFeature'), parameters('systemData').hostpoolUpdateFeature), reference(resourceId('Microsoft.DesktopVirtualization/hostpools/sessionHostConfigurations', parameters('hostpoolName'), 'default')).version, '')]"
},
"securityType": {
"value": "[parameters('securityType')]"
},
"secureBoot": {
"value": "[parameters('secureBoot')]"
},
"vTPM": {
"value": "[parameters('vTPM')]"
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions ARM-wvd-templates/nestedtemplates/managedDisks-customimagevm.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,27 @@
"description": "Session host configuration version of the host pool."
},
"defaultValue": ""
},
"securityType": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These parameters aren't passed to the virtual machine so it doesn't do anything.

"type": "string",
"metadata": {
"description": "Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings. Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch."
},
"defaultValue": ""
},
"secureBoot": {
"type": "bool",
"metadata": {
"description": "Specifies whether secure boot should be enabled on the virtual machine."
},
"defaultValue": false
},
"vTPM": {
"type": "bool",
"metadata": {
"description": "Specifies whether vTPM (Virtual Trusted Platform Module) should be enabled on the virtual machine."
},
"defaultValue": false
}
},
"variables": {
Expand Down
21 changes: 21 additions & 0 deletions ARM-wvd-templates/nestedtemplates/managedDisks-customvhdvm.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,27 @@
"description": "Session host configuration version of the host pool."
},
"defaultValue": ""
},
"securityType": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These parameters aren't passed to the virtual machine so it doesn't do anything.

"type": "string",
"metadata": {
"description": "Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings. Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch."
},
"defaultValue": ""
},
"secureBoot": {
"type": "bool",
"metadata": {
"description": "Specifies whether secure boot should be enabled on the virtual machine."
},
"defaultValue": false
},
"vTPM": {
"type": "bool",
"metadata": {
"description": "Specifies whether vTPM (Virtual Trusted Platform Module) should be enabled on the virtual machine."
},
"defaultValue": false
}
},
"variables": {
Expand Down
33 changes: 31 additions & 2 deletions ARM-wvd-templates/nestedtemplates/managedDisks-galleryvm.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,27 @@
"description": "Session host configuration version of the host pool."
},
"defaultValue": ""
},
"securityType": {
"type": "string",
"metadata": {
"description": "Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings. Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch."
},
"defaultValue": ""
},
"secureBoot": {
"type": "bool",
"metadata": {
"description": "Specifies whether secure boot should be enabled on the virtual machine."
},
"defaultValue": false
},
"vTPM": {
"type": "bool",
"metadata": {
"description": "Specifies whether vTPM (Virtual Trusted Platform Module) should be enabled on the virtual machine."
},
"defaultValue": false
}
},
"variables": {
Expand Down Expand Up @@ -347,7 +368,14 @@
"uri": "[parameters('customConfigurationParameterUrl')]"
}
},
"customConfigurationParameter": "[if(empty(parameters('customConfigurationParameterUrl')), variables('postDeploymentCustomConfigurationTemplateProperty'), union(variables('postDeploymentCustomConfigurationTemplateProperty'), variables('postDeploymentCustomConfigurationParameterProperty')))]"
"customConfigurationParameter": "[if(empty(parameters('customConfigurationParameterUrl')), variables('postDeploymentCustomConfigurationTemplateProperty'), union(variables('postDeploymentCustomConfigurationTemplateProperty'), variables('postDeploymentCustomConfigurationParameterProperty')))]",
"securityProfile": {
"uefiSettings": {
"secureBootEnabled": "[parameters('secureBoot')]",
"vTpmEnabled": "[parameters('vTPM')]"
},
"securityType": "[parameters('securityType')]"
}
},
"resources": [
{
Expand Down Expand Up @@ -405,7 +433,7 @@
]
},
{
"apiVersion": "2020-06-01",
"apiVersion": "2021-07-01",
"type": "Microsoft.Compute/virtualMachines",
"name": "[concat(parameters('rdshPrefix'), add(copyindex(), parameters('vmInitialNumber')))]",
"location": "[parameters('location')]",
Expand All @@ -429,6 +457,7 @@
"adminUsername": "[variables('vmAdministratorUsername')]",
"adminPassword": "[variables('vmAdministratorPassword')]"
},
"securityProfile": "[if(equals(parameters('securityType'), 'TrustedLaunch'), variables('securityProfile'), json('null'))]",
"storageProfile": {
"imageReference": {
"publisher": "[parameters('vmGalleryImagePublisher')]",
Expand Down
Loading