Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.22k stars 3.83k forks source link

Get-AzureAffinityGroup doesn't work correctly with -Name #65

Closed SherifTalaat closed 9 years ago

SherifTalaat commented 9 years ago

Get-AzureAffinityGroup cmdlet doesn't work correctly when using -Name parameter. It returns some empty values such as WebWorkerRoleSizes & VirtualMachineRoleSizes 01 02

singhkays commented 9 years ago

@SherifTalaat Was there any VM deployed to this affinity group? Can you paste the -Debug log and see what's being returned from the API?

SherifTalaat commented 9 years ago

@singhkay Yes, there is VMs deployed to this affinity group. Actually, I tried another Affinity Group but still get the same.

PS > Get-AzureAffinityGroup -Name CoExAffinityGroup -Debug

DEBUG: 12:39:39 PM - GetAzureAffinityGroup begin processing with ParameterSet '__AllParameterSets'. DEBUG: 12:39:42 PM - using account id 'A4EB9D27766DDC3574F69F61C852C4ED10033CB4'... VERBOSE: 12:39:44 PM - Begin Operation: Get-AzureAffinityGroup DEBUG: ============================ HTTP REQUEST ============================

HTTP Method: GET

Absolute Uri: https://management.core.windows.net/5c6a4dc1-c9b3-4570-a1b7-9c72e5e9a149/affinitygroups/CoExAffinityGroup

Headers: x-ms-version : 2014-10-01

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code: OK

Headers: x-ms-servedbyregion : ussouth2 x-ms-request-id : 4b814c1dfab77df69dff00de8e2c8157 Cache-Control : no-cache Date : Mon, 16 Feb 2015 12:39:44 GMT Server : 1.0.6198.187,(rd_rdfe_stable.150211-1556),Microsoft-HTTPAPI/2.0

Body:

CoExAffinityGroup West US https://management.core.windows.net/5c6a4dc1-c9b3-4570-a1b7-9c72e5e9a149/services/hostedservices/CoExCloud CoExCloud CoExAffinityGroup Created 2014-01-22T11:50:11Z 2014-07-10T19:54:45Z 804360333893D93D732E3E037E8AD863B95162A6 PersistentVMRole HighMemory 2012-12-30T00:07:04Z

DEBUG: ============================ HTTP REQUEST ============================

HTTP Method: GET

Absolute Uri: https://management.core.windows.net/5c6a4dc1-c9b3-4570-a1b7-9c72e5e9a149/operations/4b814c1dfab77df69dff00de8e2c8157

Headers: x-ms-version : 2014-10-01

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code: OK

Headers: x-ms-servedbyregion : ussouth2 x-ms-request-id : 9cd771b9f85971efacf0fca4054474c4 Cache-Control : no-cache Date : Mon, 16 Feb 2015 12:39:45 GMT Server : 1.0.6198.187,(rd_rdfe_stable.150211-1556),Microsoft-HTTPAPI/2.0

Body:

4b814c1d-fab7-7df6-9dff-00de8e2c8157 Succeeded 200

VERBOSE: 12:39:45 PM - Completed Operation: Get-AzureAffinityGroup

Name : CoExAffinityGroup Label : CoExAffinityGroup Description : Location : West US HostedServices : {CoExCloud} StorageServices : {} Capabilities : {PersistentVMRole, HighMemory} CreatedTime : 12/30/2012 12:07:04 AM WebWorkerRoleSizes : {} VirtualMachineRoleSizes : {} OperationDescription : Get-AzureAffinityGroup OperationId : 4b814c1d-fab7-7df6-9dff-00de8e2c8157 OperationStatus : Succeeded

DEBUG: 12:39:50 PM - GetAzureAffinityGroup end processing.

singhkays commented 9 years ago

@SherifTalaat Checked with the platform team and this is actually by design. The List Affinity Group API returns the web/worker roles but the Get Affinity Group API doesn't return those values (when you specify a name). This is the reason why it is empty in PS.