ResourceExtension [SPFSDK][VMROLE]
Se aplica a: Windows Azure Pack
Una extensión de recursos es una plantilla con versiones que describe cómo se debe instalar y configurar un recurso dentro de un recurso descrito por una definición de recurso.
Jerarquía de tipos
ResourceExtension
Sintaxis
{
"SchemaVersion": "1.0",
"Name": "string",
"Version": "string in version format",
"Publisher": "string",
"ExtensionType" : "Microsoft.Compute/EnterpiseApplicationExtension/1.0",
"DataPackage": {
"Version": "1.0.0.0",
"Location": "MyTemplatePayload",
"ExternalPayload": [
{
"RelativePath": "string",
"Hash": "string",
"URLHint": "string"
}
]
},
"ResourceExtensionParameters": { <ResourceExtensionParameters> },
"ResourceRequirements": { <ResourceRequirements> },
"ExtensionSettings": {
"ApplicationProfile": { <ApplicationProfile> }
}
}
Propiedades
Nombre |
Tipo |
Obligatorio |
Valor predeterminado |
Descripción |
---|---|---|---|---|
SchemaVersion |
String |
Sí |
None |
Versión del esquema de extensión de recursos. Siempre debe establecerse en 1.0. |
Nombre |
String |
Sí |
None |
Nombre de esta extensión de recurso. |
Versión |
String |
Sí |
None |
Versión de la extensión de recurso. El formato de la versión es: <principal>.< menor>.< build>.< release>. Por ejemplo, 6.33.2.10. |
Publicador |
String |
No |
None |
Publicador de la extensión de recursos. |
ExtensionType |
String |
Sí |
None |
Nombre del contrato que hospeda esta extensión de recursos. Identifica qué recursos pueden admitir esta extensión de recursos. Debe establecerse en Microsoft.Compute/EnterpiseApplicationExtension/1.0. |
DataPackage |
DataPackage |
No |
null |
Ubicación de la carga que usa el paquete. |
ResourceExtensionParameters |
Matriz de parámetros y tipos [SPFSDK][VMROLE] |
No |
null |
Matriz de parámetros declarados por la extensión de recursos. |
ResourceRequirements |
No |
null |
Requisitos que la extensión de recurso tiene en su recurso. |
|
ExtensionSettings |
Sí |
None |
Las aplicaciones y las configuraciones de invitado para la máquina virtual de hospedaje. |
DataPackage
Nombre |
Tipo |
Obligatorio |
Valor predeterminado |
Descripción |
---|---|---|---|---|
Versión |
String |
Sí |
None |
Versión del paquete de datos. El formato de la versión es: <principal>.< menor>.< build>.< release>. Por ejemplo, 6.33.2.10. |
Location |
String |
Sí |
None |
Ruta de acceso relativa dentro del archivo del paquete de extensión de recursos que contiene la carga de la extensión. |
ExternalPayload |
Matriz de ExternalPayload |
No |
None |
El archivo que la extensión de recursos requiere que no se redistribuya como parte del archivo del paquete de extensión de recursos. |
ExternalPayload
Nombre |
Tipo |
Obligatorio |
Valor predeterminado |
Descripción |
---|---|---|---|---|
RelativePath |
String |
Sí |
None |
Ruta de acceso relativa del paquete de extensión de recursos que existe el archivo. |
Hash |
String |
No |
None |
Hash SHA256 del archivo de carga externa. |
URLHint |
String |
No |
None |
Dirección URL que se puede usar para descargar el archivo de carga externa. |
Comentarios
En el ejemplo de código siguiente se proporciona un objeto ResourceExtension de ejemplo.
{
"Name": "MyVirtualMachineRoleExtension",
"Version": "Version of the resource extension",
"Publisher": "Publisher of Extension",
"SchemaVersion": "1.0",
"ExtensionType": "Microsoft.Compute/ EnterpiseApplicationExtension/1.0",
"DataPackage": {
"Version": "1.0.0.0",
"Location": "MyTemplatePayload",
"ExternalPayload": [
{
"RelativePath": "sharepoint.msi",
"Hash": "...",
"URLHint": "http://<webpage-to-download-sharepoint>"
}
]
},
"ResourceExtensionParameters": [
{
"Name": "SQLInstance",
"Type": "string",
"Description": "my description"
},
{
"Name": "ConnectionString",
"Type": "string",
"Description": "my description"
},
{
"Name": "SharepointDB",
"Type": "string",
"Description": "my description"
}
],
"ResourceRequirements": {
"OSVirtualHardDiskRequirements": [
"WS2008",
"SysprepSQL"
],
},
"ExtensionSettings": {
"ApplicationProfile": {
"Name": "ApplicationProfile1",
"ApplicationPayload": [
{
"ID": "49c1ccdb-9068-4b91-9409-0a7ca8a1d291",
"RelativePath": "sharepointfiles"
}
],
"LinuxApplicationProfile": {
"RunOnceCommands": [
"ifconfig"
]
},
"WindowsApplicationProfile": {
"WindowsServerRolesAndFeatures": [
"TFTP-Client"
],
"SQLProfile": {
"SQLDeployments": [
{
"DeploymentName": "SQL Deployment 1",
"InstanceName": "[Param.SQLInstance]",
"InstanceID": "[Param.SQLInstance]",
"EnableNamedPipes": false,
"EnableTCP": true,
"MediaSource": "c:\\SQLMediaPath\\sqlsetup.exe",
"ProductKey": "abcdefghijklmnopqrstuvwxyz",
"SQLAuthenticationType": "WindowsAuthentication",
"SQLSysAdminMemberList": "domain\\user",
"DeploymentTimeOutInSeconds": 3600,
"SQLConfigurationPayloadId": "61A33949-46CE-4d0f-921F-A0059DA9AD1F",
"SAPassword": "MySAPassword",
"SQLDeploymentCredential": "domain\\user:password",
"SQLAgentServiceCredential": "NT AUTHORITY\\System:",
"SQLServiceCredential": "NT AUTHORITY\\NetworkService:",
"SQLReportingServiceCredential": "domain\\user:password"
}
]
},
"ProvisioningScripts": [
{
"AlwaysReboot": false,
"ApplicationPayloadId": "49c1ccdb-9068-4b91-9409-0a7ca8a1d291",
"DeploymentOrder": 1,
"ErrorPolicy": "FailOnMatch",
"ExecutableAndParams": {
"Executable": "cmd.exe",
"Parameters": "/q /c msiexec sharepoint.msi"
},
"ExitCodeRegex": "[1-9][0-9]*",
"MaxOutputSize": 1048576,
"RebootExitCodeRegex": "{1641}|{3010}|{3011}",
"RestartOnRetry": false,
"ScriptBlock": null,
"ScriptCredential": "domain\\user:password",
"ScriptType": "PreInstall",
"StandardErrorPath": "c:\\err.txt",
"StandardErrorRegex": ".+",
"StandardInput": null,
"StandardOutputPath": "c:\\out.txt",
"StandardOutputRegex": null,
"TimeoutInSeconds": 900,
"WorkingDirectory": null
}
],
"WebDeployApplications": [
{
"DeploymentName": "WebDeploy App 1",
"ScriptCommands": [
{
"AlwaysReboot": false,
"ApplicationPayloadId": "366819c2-bf11-4c85-9555- 6293e2a3ce7b",
"ErrorPolicy": "FailOnMatch",
"ExecutableAndParams": {
"Executable": "cmd.exe",
"Parameters": "/q /c installwebdeploy.cmd"
},
"ExitCodeRegex": "[1-9][0-9]*",
"MaxOutputSize": 1048576,
"RebootExitCodeRegex": "{1641}|{3010}|{3011}",
"RestartOnRetry": false,
"ScriptBlock": null,
"ScriptCredential": "domain\\user:password",
"ScriptType": "PreInstall",
"StandardErrorPath": "c:\\err.txt",
"StandardErrorRegex": ".+",
"StandardInput": null,
"StandardOutputPath": "c:\\out.txt",
"StandardOutputRegex": null,
"TimeoutInSeconds": 900,
"WorkingDirectory": null
}
],
"DeploymentName": "Deployment1",
"ApplicationPayloadId": "371ade4c-03a2-492d-9589-b399b940e44f",
"PackagePassword": "mypassword2",
"WebDeployParameters": [
{
"ParameterName": "CONNECTION_STRING",
"Value": "[Param.ConnectionString]"
}
]
}
],
"SQLDacApplications": [
{
"DeploymentName": "SQL App 1",
"ScriptCommands": [
{
"AlwaysReboot": false,
"ApplicationPayloadId": null,
"ErrorPolicy": "FailOnMatch",
"ExecutableAndParams": null,
"ExitCodeRegex": "[1-9][0-9]*",
"MaxOutputSize": 1048576,
"RebootExitCodeRegex": "{1641}|{3010}|{3011}",
"RestartOnRetry": false,
"ScriptBlock": "rem some script that needs to run before sqldac package is installed",
"ScriptCredential": {
"Password": "mypassword4",
"UserName": "dcmanagerlab\\esdcvsec4"
},
"ScriptType": "PreInstall",
"StandardErrorPath": "c:\\err.txt",
"StandardErrorRegex": ".+",
"StandardInput": null,
"StandardOutputPath": "c:\\out.txt",
"StandardOutputRegex": null,
"TimeoutInSeconds": 900,
"WorkingDirectory": null
}
],
"SQLScriptCommands": [
{
"DatabaseName": "[Param.SharepointDB]",
"DeploymentOrder": 1,
"EncryptConnection": false,
"ExecutionTimeoutSeconds": 500,
"LoginTimeoutSeconds": 50,
"OutputFilePath": "c:\\sharepointDB.sql.log",
"SQLAuthenticationType": "WindowsAuthentication",
"SQLScriptApplicationPayloadId": "db04416b-d0a8-44d5-b0ee-d5739378a98d",
"ScriptCredential": "[Param.SQLScriptCommandCredential]",
"ScriptType": "PostInstall"
}
],
"DeploymentName": "Deployment1",
"ApplicationPayloadId": "5b064b6a-d6d0-48f0-8979-9aafc676a9e5",
"BlockOnChanges": false,
"DacInstance": "[Param.SharepointDB]",
"IgnoreDataLoss": false,
"RollbackOnFailure": true,
"SQLAuthenticationType": "WindowsAuthentication",
"SQLDeploymentCredential": "[param.SQLDeploymentCredential]",
"SQLInstance": "[Param.SQLInstance]",
"SkipPolicyValidation": true,
"UninstallMode": "DropDatabase"
}
],
"ScriptApplications": [
{
"DeploymentName": "ScriptDeployment1",
"ScriptCommands": [
{
"AlwaysReboot": false,
"ApplicationPayloadId": "366819c2-bf11-4c85-9555- 6293e2a3ce7b",
"ErrorPolicy": "FailOnMatch",
"ExecutableAndParams": {
"Executable": "cmd.exe",
"Parameters": "/q /c installwebdeploy.cmd"
},
"ExitCodeRegex": "[1-9][0-9]*",
"MaxOutputSize": 1048576,
"RebootExitCodeRegex": "{1641}|{3010}|{3011}",
"RestartOnRetry": false,
"ScriptBlock": null,
"ScriptCredential": "domain\\user:mypassword",
"ScriptType": "PreInstall",
"StandardErrorPath": "c:\err.txt",
"StandardErrorRegex": ".+",
"StandardInput": null,
"StandardOutputPath": "c:\out.txt",
"StandardOutputRegex": null,
"TimeoutInSeconds": 900,
"WorkingDirectory": null
}
],
"EnvironmentVariables": [
{
"Name": "envvar1",
"Value": "foo",
},
{
"Name": "envvar2",
"Value": "bar",
},
],
"AlwaysReboot": false,
"ApplicationPayloadId": "49c1ccdb-9068-4b91-9409-0a7ca8a1d291",
"ErrorPolicy": "FailOnMatch",
"ExecutableAndParams": {
"Executable": "cmd.exe",
"Parameters": "/q /c msiexec sharepoint.msi"
},
"ExitCodeRegex": "[1-9][0-9]*",
"MaxOutputSize": 1048576,
"RebootExitCodeRegex": "{1641}|{3010}|{3011}",
"ScriptBlock": null,
"ScriptCredential": "username:password",
"StandardErrorPath": "c:\err.txt",
"StandardErrorRegex": ".+",
"StandardInput": null,
"StandardOutputPath": "c:\out.txt",
"StandardOutputRegex": null,
"TimeoutInSeconds": 900,
"WorkingDirectory": null
}
]
}
}
}
}
Consulte también
Referencia JSON del rol de máquina virtual [SPFSDK][VMROLE]
VirtualMachineRole (instancia) [SPFSDK][VMROLE]
ResourceDefinition [SPFSDK][VMROLE]
ResourceConfiguration [SPFSDK][VMROLE]
Parámetros y tipos [SPFSDK][VMROLE]
ResourceRequirements [SPFSDK][VMROLE]
ExtensionSettings [SPFSDK][VMROLE]