是否有办法通过电源外壳或ARM模板获得Azure存储同步服务中注册服务器的服务器ID ?


{
"name": "string",
"type": "Microsoft.StorageSync/storageSyncServices/syncGroups/serverEndpoints",
"apiVersion": "2019-06-01",
"properties": {
"serverLocalPath": "string",
"cloudTiering": "string",
"volumeFreeSpacePercent": "integer",
"tierFilesOlderThanDays": "integer",
"friendlyName": "string",
"serverResourceId": "string",
"offlineDataTransfer": "string",
"offlineDataTransferShareName": "string"
}
}

在上述模板格式中需要作为服务器资源id传递的内容用于存储同步。如何获取服务器id ?

是。使用来自Az.StorageSync模块的Get-AzStorageSyncServerEndpoint cmdlet来列出给定同步组中的所有服务器端点。

Get-AzStorageSyncServerEndpoint -ResourceGroupName "myResourceGroup" -StorageSyncServiceName "mysyncservice" -SyncGroupName "testsyncgroup"

示例响应:

SyncGroupName                               : testsyncgroup
StorageSyncServiceName                      : mysyncservice
ServerLocalPath                             : C:UsersonpremwindowsDesktopmyfolder
ServerResourceId                            : /subscriptions/***/resourceGroups/myResourceGroup/providers/microsoft.stor
agesync/storageSyncServices/mysyncservice/registeredServers/8ec8b78c-0739-195r-856e-2e7r5ta2c13w
ServerEndpointName                          : 94e9fd59-23d6-9854-99c1-3e9a8ab73760
ProvisioningState                           : Succeeded
LastWorkflowId                              : storageSyncServices/mysyncservice/workflows/bd3o8c77-7183-4a46-8830-9b156dd2f011
LastOperationName                           : ICreateServerEndpointWorkflow
FriendlyName                                : onpremwindows
SyncStatus                                  : Microsoft.Azure.Commands.StorageSync.Models.PSServerEndpointHealth
CloudTiering                                : Off
VolumeFreeSpacePercent                      : 20
TierFilesOlderThanDays                      :
OfflineDataTransfer                         : Off
OfflineDataTransferShareName                :
OfflineDataTransferStorageAccountResourceId :
OfflineDataTransferStorageAccountTenantId   :
InitialDownloadPolicy                       : NamespaceThenModifiedFiles
LocalCacheMode                              : UpdateLocallyCachedFiles
ResourceId                                  : /subscriptions/***/resourceGroups/myResourceGroup/providers/microsoft.stor
agesync/storageSyncServices/mysyncservice/syncGroups/testsyncgroup/serverEndpoints/94e9fd59-23d6-9854-99c1-3e9a8ab73760
ResourceGroupName                           : myResourceGroup
Type                                        : microsoft.storagesync/storageSyncServices/syncGroups/serverEndpoints

8ec8b78c-0739-195r-856e-2e7r5ta2c13w将是您可以传递的ServerId。

您也可以使用Get-AzStorageSyncService命令获取ServerId:

Get-AzStorageSyncService -ResourceGroupName "myResourceGroup" -StorageSyncServiceName "mysyncservice"

示例响应:

StorageSyncServiceName    : mysyncservice
ServerName                : 8ec8b78c-0739-195r-856e-2e7r5ta2c13w
ServerCertificate         :
AgentVersion              : 8.0.0.0
ServerOSVersion           : 10.0.14393.0
ServerManagementErrorCode : 0
LastHeartBeat             : 12/10/2019 12:55:01
ProvisioningState         : Succeeded
ServerRole                : Standalone
ClusterId                 : 00000000-0000-0000-0000-000000000000
ClusterName               :
ServerId                  : 8ec8b78c-0739-195r-856e-2e7r5ta2c13w
StorageSyncServiceUid     : 76104503-6cd8-4812-7884-c4288e87a8cd
LastWorkflowId            : storageSyncServices/finalsync/workflows/0e3bc737-7619-4b42-81a9-aec36e3fbf53
LastOperationName         : ICreateRegisteredServerWorkflow
DiscoveryEndpointUri      : https://tm-server.xxx.com:443
ResourceLocation          : eastasia
ServiceLocation           : eastasia
FriendlyName              : onpremwindows
ManagementEndpointUri     : https://tm-server.xxx.com:443
MonitoringEndpointUri     : https://tm-server.xxx.com:443
ResourceId                : /subscriptions/***/resourceGroups/myResourceGroup/providers/microsoft.storagesync/storageSyncServices/mysyncservice/registeredServers/8ec8b78c-0739-195r-856e-2e7r5ta2c13w
ResourceGroupName         : myResourceGroup
Type                      : microsoft.storagesync/storageSyncServices/registeredServers

相关内容

  • 没有找到相关文章

最新更新