-
Notifications
You must be signed in to change notification settings - Fork 2k
New Microsoft Azure docker-machine driver #3159
Conversation
// NOTE(ahmetalpbalkan): any driver initialization I do here gets lost | ||
// afterwards, especially for non-Create RPC calls. Therefore I am mostly | ||
// making rest of the driver stateless by just relying on the following | ||
// piece of info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which pieces of info are you missing here? On operations subsequent to create
invocation, []byte
from disk (config.json
file) for driver will be unmarshaled into the struct
directly, after the NewDriver
function returns the initial struct, so it's not unexpected behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nathanleclaire I believe from what I tried, assigning certain objects during various points of this object's lifetime caused those instances to get lost. So it is not very clear to me at which exact point this config data gets marshaled and unmarshaled.
For instance, when I assign something here during create or pre-create, I saw that it totally gets lost during GetState/GetIP calls that occur later during the machine creation.
For quite a moment I thought maybe it is reinitializing the driver for those calls –but this is not an external driver, I was assuming it'd be in-process and there'd be only a single azure Driver instance throughout the lifetime of a docker-machine execution process; but it appears like due to RPC that's not the case.
I'm still not clear about inner workings of RPC model in docker-machine. I found my way around it but guess I still appreciate any explanation about lifecycle of Driver instance and when/how config gets (un)marshaled.
Made a few comments / questions but it's looking really good! Thanks for taking the initiative on this. My general feeling is that I want to err on the side of merging this soon, and testing-as-we-go. Also, with this branch of development, we're breaking backwards compatibility with old |
@nathanleclaire I have the same opinion, I feel like it's in a usable state already.
It is completely breaking (I have a comment about this in |
The new driver uses Azure Resource Manager APIs and offers a lot more functionality compared to the old Azure driver. It is also easier to authenticate and does not require user to create and place certificate files. It only has a single required argument. This is a breaking change: The new driver cannot work with machines created with the older Azure driver and vice versa (as the APIs are entirely different and resources are not shared between old/new azure APIs). The new driver addresses many issues about the azure driver reported so far. This resolves #2742, resolves #1368, resolves #1142, resolves #2236, resolves #2408, resolves #1126, resolves #774. Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
The Azure driver uses the `b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-15_10-amd64-server-20151116.1-en-us-30GB` | ||
image by default. Note, this image is not available in the Chinese regions. In China you should | ||
specify `b549f4301d0b4295b8e76ceb65df47d4__Ubuntu-15_10-amd64-server-20151116.1-en-us-30GB`. | ||
After authenticating, the driver will remember your credentials up to two weeks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be good to add a comment saying that, if someone wants to automate using docker-machine, they will have to provide publishsettings or subscriptionID, cert pair
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not anymore. Please look at the azure.md as a whole, not a diff. The new driver has nothing to do with the old driver, including the authentication model. It's beneficial to not think of the old Azure driver here at all. The new Azure APIs are a complete paradigm change in pretty much every aspect.
Is there any way to provide users a script or something that will migrate old versions of VMs created with the Let's talk about options to preserve and migrate existing |
@nathanleclaire fair point. I was not aware of two versions policy, though I remember asking about it in our earlier conversations (:P). A migration is just not possible. What I can offer is, maybe we keep azure driver around for another release and call this `azure-new then fix it later? Basically if you ask me, I don't think people will be disappointed if we break with a nice error message saying "hey this version doesn't support old Azure VMs, please go back to v0.6.0", but up to you. |
Or we can call this |
So, consensus on our end after talking with @dmp42 is that:
How does that sound? Are you willing to work with us on verifying that the above works as expected? I've not had much success with the legacy Azure driver in the past unfortunately. The tricky bit in the above will be preventing damage to the |
@nathanleclaire That sounds good. It looks like I just have to make sure we don't damage config.json and terminate early when we detect the old Actually this new driver already errors out and doesn't damage config.json for old Azure VMs but I will make the error clearer. |
OK sounds great. Thanks Ahmet. |
@dgageot just pushed a commit fixing this. Sorry for the trouble. API folks are looking at why some namespaces might be returned as lowercase for some users. Thanks for reporting this. |
LGTM |
@dgageot thanks for reviewing and testing, I really appreciate we found that bug before the release. We currently don't know how many users are getting this different uppercase/lowercase output from the APIs but we got it covered for now. |
ping @nathanleclaire |
Going to take it for a test drive, then most likely merge. cc @londoncalling for docs review; if there are any problems, I suggest we open and issue and do a follow-up PR. |
|
||
Grab your subscription ID from the portal, then run `docker-machine create` with these details: | ||
First time you try to create a machine, Azure driver will ask you to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first time you try to ...etc.
I made some wording corrections in inline comments for azure.md, but haven't had time to test the driver yet. If you like, I can update for flow of the text in the azure.md file after this is merged. There's just a lot of nitpicky things I would change throughout about the wording. |
Please sign your commits following these rules: $ git clone -b "azure-arm" git@github.com:ahmetalpbalkan/machine.git somewhere
$ cd somewhere
$ git rebase -i HEAD~7
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f Ammending updates the existing PR. You DO NOT need to open a new one. |
Please sign your commits following these rules: $ git clone -b "azure-arm" git@github.com:ahmetalpbalkan/machine.git somewhere
$ cd somewhere
$ git rebase -i HEAD~7
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f Ammending updates the existing PR. You DO NOT need to open a new one. |
1 similar comment
Please sign your commits following these rules: $ git clone -b "azure-arm" git@github.com:ahmetalpbalkan/machine.git somewhere
$ cd somewhere
$ git rebase -i HEAD~7
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f Ammending updates the existing PR. You DO NOT need to open a new one. |
@londoncalling thanks for reviewing, just addressed docs comments in a separate commit (9fd035e) |
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
@ahmetalpbalkan How exactly does one get an Azure subscription ID? This screen doesn't have any and can't figure out how to get one. |
@nathanleclaire hmm that's weird I didn't know you could have an Azure account without having a subscription. Try http://azure.com/free to get a Trial Subscription. |
Guess I had a free trial one that expired so maybe Azure got confused. I am starting the whole funnel again from that link you sent me -- think this should work. |
Create and other expected operations works smoothly for me (and create is miles ahead of the old driver in terms of user experience -- excellent job!). LGTM Thanks and congratulations on all your good work Ahmet and everyone else involved in bringing this to fruition. |
New Microsoft Azure docker-machine driver
@nathanleclaire @dgageot It's very delightful to hear all these, thank you for taking time to review this as well. I will be sending the improvements incrementally. |
Great work @ahmetalpbalkan! I have started rebasing my change. Also, filed an issue based on our discussion above about automation. |
Great work! |
The new driver uses Azure Resource Manager APIs and offers a lot
more functionality compared to the old Azure driver. It is also
easier to authenticate and does not require user to create and place
certificate files. It only has a single required argument.
This is a breaking change: The new driver cannot work with machines
created with the older Azure driver and vice versa (as the APIs are
entirely different and resources are not shared between old/new azure
APIs).
The new driver addresses many issues about the azure driver reported
so far. Please read
azure.md
for docs about what's new.This resolves #2742, resolves #1368, resolves #1142, resolves #2236,
resolves #2408, resolves #1126, resolves #774.