استخدام الملحقات مع مجموعات Batch
الملحقات هي تطبيقات صغيرة تسهم في تسهيل التكوين اللاحق للتوفير، والإعداد على عقد حساب Batch. يمكنك تحديد أي من الملحقات المسموح بها من قبل Azure Batch وتثبيتها على عقد الحساب أثناء توفيرها. بعد ذلك، يمكن للملحق تنفيذ العملية المنشودة منه.
يمكنك التحقق من الحالة المباشرة للملحقات التي تستخدمها واسترداد المعلومات التي ترجعها لمتابعة أي قدرات للكشف أو التصحيح أو التشخيص.
المتطلبات الأساسية
- يجب أن تستخدم المجموعات ذات الملحقات تكوين الجهاز الظاهري.
- يتم حجز نوع ملحق CustomScript لخدمة Azure Batch ولا يمكن تجاوزه.
- قد تحتاج بعض الملحقات "الهوية المدارة" على مستوى المجموعة، والتي يمكن الوصول إليها في سياق عقدة حساب كي تعمل بشكل صحيح. راجع تكوين الهويات المدارة في تجمعات الدفعات إذا كان ذلك ممكنا للملحقات.
تلميح
لا يمكن إضافة الملحقات إلى تجمع موجود. يجب إعادة إنشاء التجمعات لإضافة الملحقات أو إزالتها أو تحديثها.
الملحقات المدعومة
يمكن تثبيت الملحقات التالية حالياً عند إنشاء مجموعة Batch:
- ملحق Azure Key Vault لأنظمة Linux
- ملحق Azure Key Vault لأنظمة Windows
- ملحق Azure Monitor Logs للتحليلات والمراقبة لأنظمة Linux
- ملحق Azure Monitor Logs للتحليلات والمراقبة لأنظمة Windows
- ملحق تكوين Azure Desired State (DSC)
- ملحق Azure Diagnostics لأجهزة Windows الظاهرية
- ملحق برنامج تشغيل HPC GPU لأنظمة Windows على معالجات AMD
- ملحق برنامج تشغيل HPC GPU لأنظمة Windows على معالجات NVIDIA
- ملحق برنامج تشغيل HPC GPU ل Linux على NVIDIA
- ملحق Microsoft Antimalware لأنظمة Windows
- عامل Azure Monitor لنظام Linux
- عامل Azure Monitor لنظام التشغيل Windows
يمكنك طلب الدعم للناشرين الآخرين و/أو أنواع الملحقات عن طريق فتح طلب دعم.
إنشاء تجمع مع ملحقات
ينشئ المثال التالي مجموعة دفعات من عقد Linux/Windows التي تستخدم ملحق Azure Key Vault.
REST API URI
PUT https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroup>/providers/Microsoft.Batch/batchAccounts/<batchaccountName>/pools/<batchpoolName>?api-version=2021-01-01
نص الطلب لعقدة Linux
{
"name": "test1",
"type": "Microsoft.Batch/batchAccounts/pools",
"properties": {
"vmSize": "STANDARD_DS2_V2",
"taskSchedulingPolicy": {
"nodeFillType": "Pack"
},
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"publisher": "microsoftcblmariner",
"offer": "cbl-mariner",
"sku": "cbl-mariner-2",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.mariner 2.0",
"extensions": [
{
"name": "secretext",
"type": "KeyVaultForLinux",
"publisher": "Microsoft.Azure.KeyVault",
"typeHandlerVersion": "3.0",
"autoUpgradeMinorVersion": true,
"settings": {
"secretsManagementSettings": {
"pollingIntervalInS": "300",
"certificateStoreLocation": "/var/lib/waagent/Microsoft.Azure.KeyVault",
"requireInitialSync": true,
"observedCertificates": [
"https://testkvwestus2.vault.azure.net/secrets/authsecreat"
]
},
"authenticationSettings": {
"msiEndpoint": "http://169.254.169.254/metadata/identity",
"msiClientId": "885b1a3d-f13c-4030-afcf-9f05044d78dc"
}
},
"protectedSettings": {}
}
]
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0,
"resizeTimeout": "PT15M"
}
}
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/ACR/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumaforpools": {}
}
}
}
طلب النص الأساسي لعقدة Windows
{
"name": "test1",
"type": "Microsoft.Batch/batchAccounts/pools",
"properties": {
"vmSize": "STANDARD_DS2_V2",
"taskSchedulingPolicy": {
"nodeFillType": "Pack"
},
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"publisher": "microsoftwindowsserver",
"offer": "windowsserver",
"sku": "2022-datacenter",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"extensions": [
{
"name": "secretext",
"type": "KeyVaultForWindows",
"publisher": "Microsoft.Azure.KeyVault",
"typeHandlerVersion": "3.0",
"autoUpgradeMinorVersion": true,
"settings": {
"secretsManagementSettings": {
"pollingIntervalInS": "300",
"requireInitialSync": true,
"observedCertificates": [
{
"https://testkvwestus2.vault.azure.net/secrets/authsecreat"
"certificateStoreLocation": "LocalMachine",
"keyExportable": true
}
]
},
"authenticationSettings": {
"msiEndpoint": "http://169.254.169.254/metadata/identity",
"msiClientId": "885b1a3d-f13c-4030-afcf-9f05044d78dc"
}
},
"protectedSettings":{}
}
]
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0,
"resizeTimeout": "PT15M"
}
}
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/ACR/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumaforpools": {}
}
}
}
الحصول على بيانات الملحق من مجموعة
يسترد المثال التالي البيانات من ملحق Azure Key Vault.
REST API URI
GET https://<accountName>.<region>.batch.azure.com/pools/<poolName>/nodes/<tvmNodeName>/extensions/secretext?api-version=2010-01-01
هيئة الاستجابة
{
"odata.metadata": "https://testwestus2batch.westus2.batch.azure.com/$metadata#extensions/@Element",
"instanceView": {
"name": "secretext",
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": 0,
"displayStatus": "Provisioning succeeded",
"message": "Successfully started Key Vault extension service. 2021-02-08T19:49:39Z"
}
]
},
"vmExtension": {
"name": "KVExtensions",
"publisher": "Microsoft.Azure.KeyVault",
"type": "KeyVaultForLinux",
"typeHandlerVersion": "1.0",
"autoUpgradeMinorVersion": true,
"settings": "{\r\n \"secretsManagementSettings\": {\r\n \"pollingIntervalInS\": \"300\",\r\n \"certificateStoreLocation\": \"/var/lib/waagent/Microsoft.Azure.KeyVault\",\r\n \"requireInitialSync\": true,\r\n \"observedCertificates\": [\r\n \"https://testkvwestus2.vault.azure.net/secrets/testumi\"\r\n ]\r\n },\r\n \"authenticationSettings\": {\r\n \"msiEndpoint\": \"http://169.254.169.254/metadata/identity\",\r\n \"msiClientId\": \"885b1a3d-f13c-4030-afcf-922f05044d78dc\"\r\n }\r\n}"
}
}
استكشاف أخطاء ملحق Key Vault وإصلاحها
إذا تم تكوين ملحق Key Vault بشكل غير صحيح، فقد تكون عقدة الحساب في حالة قابلة للاستخدام. لاستكشاف أخطاء فشل ملحق Key Vault وإصلاحها، يمكنك تعيين requireInitialSync مؤقتا إلى خطأ وإعادة نشر التجمع الخاص بك، ثم عقدة الحساب في حالة الخمول، يمكنك تسجيل الدخول إلى عقدة الحساب للتحقق من سجلات ملحق KeyVault بحثا عن الأخطاء وإصلاح مشكلات التكوين. تفضل بزيارة ارتباط مستند ملحق Key Vault التالي لمزيد من المعلومات.
الخطوات التالية
- تعرف على الطرق المُختلفة لنسخ التطبيقات والبيانات من عقد المجموعة.
- تعرف على المزيد حول كيفية العمل مع العقد والمجموعات.