-
Notifications
You must be signed in to change notification settings - Fork 860
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
Evenhub Disaster Recovery Config with alternate name cannot be deleted #5893
Comments
This seems to be a problem with the service side, I tagged this issue with Service Attention to notify the service team about this. |
@katbyte, we are looking at this issue and we will share our findings/request for more information. |
Would you be able to provide the code snippet you are using? Please do not share anything sensitive. Are you setting up an alias with the primary and secondary pointing to the same namespace? |
@katbyte This is actually by design. If you set your alias to be the same as your primary namespace name, the alias/DRC cannot be deleted. This is because the DNS entry is cleaned up as part of the delete and this will make the namespace inaccessible if a delete was done in this particular case. What was the reason for setting the alias name to be the same as the primary namespace? |
@jfggdl, The terraform config that trigger it is:
So it is two separate namespaces. And there seems to be no way to "unset" an alternate name |
@katbyte Based on your config, it looks like you are setting the DR config name to the primary namespace name. Which is why you are unable to delete it, as explained in my previous comment. If you don't actually need your alias connection string to be the same as your primary connection string, you should set the DR config name (AKA alias) to something other than the primary namespace name. In this case, you will be able to delete the DR config. |
I'm not sure i follow. If i set the name to something other than the primary namespace's name i'm not allowed to set an alternate name. And if i set an alternate name i can no longer delete the namespace...
and if i try to change the name to something else:
Maybe i am doing things in the wrong order or missing something? |
@katbyte That's correct, the alternate name is only supported when the alias and primary namespace are the same. Do not set the alternate name if you want to be able to delete your DR config (along with setting a different alias than the primary namespace name). The alternate name is basically there to allow you to make requests to your formerly primary namespace post-failover in the case where the alias and primary namespace name were the same. It would not be required if your alias is different than your primary namespace name. |
But that is the problem, how does one delete an EH DRC once you've set an alternate name? I don't understand why that workflow can't be made possible? |
@katbyte Unfortunately it's just not something that's currently possible, for the reasons I mentioned in my first comment. Once you've set up a DR config where the alias (config name) is the same as the primary name, it cannot be deleted. Can I ask what you're trying to achieve? Why do you want to delete the DR config in this particular case? |
@AliMohsen, that seems like a bug.. if i understand correctly once you provision this resource and then add an alternate name then there is no way to remove the alternate name or delete it? - what is the reason the alternate name cannot be removed? We are personally testing it so users of our tool (terraform) can provision, update, and delete resources. |
@katbyte , you can delete the alias if it is not associated with any secondary. Make sure that no dependencies exist and deleting the primary namespace will delete the alias as well |
@ShubhaVijayasarathy, could youj elaborate on the steps to delete a DRC with an alternate name then? Lets say i have created one and added a alternate name, what are the next steps to delete the DRC? |
Hi @katbyte , What Shubha is saying is that you can delete the namespace itself, and as a result, the DR Config for that namespace will also be deleted. You will not be able to delete the DR Config alone, if you have set the DR Config name (alias) to be the same as the primary namespace name. The only way is to delete the namespace itself. |
I'm not setting the alias to the same name as the primary? Actually i'm not sure what the alias is because the API doesn't have any property called alias - just alternate name. we set that to something different: For clarification what API property sets the alias? because afaik i'm not setting it to the same thing. |
Hi @katbyte Sorry for the confusion. When you create a disaster recovery config through the SDK, you pass in an alias parameter. See here: https://godoc.org/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus#DisasterRecoveryConfigsClient.CreateOrUpdate This basically just maps to the DR Config name, this is the name parameter you've referenced here:
Here you have this set as the primary namespace name referenced by "testa". |
Sorry that is my mistake, i am not entirely familiar with the terms of this API. So it appears i have to set the alias to the same name as the primary because otherwise i cannot set an alternate name. You get the error |
You can go back to my original answer for the answer to that question :). The alternate name is only there as a workaround for cases where the alias and primary namespace name are the same. If you do set the primary namespace and alias to be the same, then it is impossible to delete the DRC and this is by design. The reason for this is in my reply here. The only way the DRC can be deleted in this case, is if you deleted the primary namespace itself. If you were to set up your DRC the recommended way, which is to use a different alias name than the primary namespace name and not set the alternate name. You can delete the DRC. |
And this is what I see as a bug in the API :) I would expect to be able to delete the DRC without having to delete the primary namespace, IE remove this resource without having to remove an entirely separate one. Not be able able to remove a DRC sounds like a bug to me. As it appears the code to detect this condition exists, should the API not just conditionally remove the DNS entry? if they are the same preserve the DNS entry, and if different delete. This would allow users to remove the DRC from a namespace rather then forcing them to delete it. |
As mentioned in the commentary, this issue is by design. Thank you for bringing this issue to our attention, and in the future we will consider altering our internal design to decouple deletion of the DRC from the lifecycle of the primary namespace in this scenario. Unfortunately we cannot commit to a timeline at present due to resource constraints. |
Bug Report
.../services/compute/mgmt/2018-06-01/compute
"github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub"
master
,latest
,18.1.0
column output by
dep status "github.com/Azure/azure-sdk-for-go
.go version
go version go1.12.6 darwin/amd64
Once an alternate name has been assigned to an eventhub DRC it doesn't seem possible to delete it via the SDK:
Error: errors during apply: Error issuing delete request for EventHub Namespace Disaster Recovery Configs "acctest-EHN-190925153556128780-a" (Namespace "acctest-EHN-190925153556128780-a" / Resource Group "acctestRG-190925153556128780"): eventhub.DisasterRecoveryConfigsClient#Delete: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="Cannot delete as Alias and Primary Namespace are same. CorrelationId: 7ec915de-1460-8a33-edc2-0e4e16faa34b"
And removing the alternative name doesn't seem to be possible:
Error: Error creating/updating EventHub Namespace Disaster Recovery Configs "acctest-EHN-190925181808103471-a" (Namespace "acctest-EHN-190925181808103471-a" / Resource Group "acctestRG-190925181808103471"): eventhub.DisasterRecoveryConfigsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="LinkedInvalidPropertyId" Message="Property id '' at path 'properties.partnerNamespace' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'."
What did you expect or want to happen?
the DRC to be deleted
How can we reproduce it?
assign a alternative name to a DRC and attempt to delete it (after breaking the pair)
Anything we should know about your environment.
The text was updated successfully, but these errors were encountered: