-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fluent flow in VM::OSDisk #697
Comments
@jianghaolu can you put the EBNF notation for the same? |
|
Thanks Jianghaolu. For others who are reading this discussion: Above is Extended Backus-Naur Form (EBNF) notation representing the context and method chains in fluent API for VM OSDisk and OSProfile. The Railroad diagram is generated using http://www.bottlecaps.de/rr/ui. |
From the graph, it may make more sense to move the admin/password setup for Windows before the configurations as they are the required parameters. |
Yes, in general we follow the pattern of keep "optionals parameters" after all "required parameters". But in this case - was thinking that "configuration" is specific to "Windows OS" [autoupdate, winrm] and keeping it close to "WithWindowsOS()" provide better redability than placing it after "withAdminPassword". "withAdminPassword" is applicable for both Windows and Linux. Do you have any specific reason for this suggestion other than the problem of breaking the pattern? azure.virtualmachines().define("vm-name")
.withRegion("region")
.withNewResourceGroup("rg1")
.withImage("WinServer", , ,)
.withWindowsOS()
.defineConfiguration()
.disableVMAgent()
.withWinRMListeners(lst)
.apply()
.withAdminUserName(uname)
.withAdminPassword(pwd)
.withNetwork("10.1.1.1/24")
.withPublicIP(dns-name)
.create(); v/s
Also, @selvasingh recommended to use "set()" instead of "apply()", that make sense because we are already using "apply()" in "Updatble" chain. Instead of "disableVMAgent", we can use "withoutVMAgent" - The name "disableVMAgent()" gives an impression that - VM agent is installed by default but user want to disable it. In reality, if this flag is false Azure won't install VM Agent. |
I don't feel strongly towards either of the options. But I personally like |
Ok, we can decide on placement of config options later. Agree, so for top-level resources renames are For optional child complex definitions that start with 'defineXXXXX()' can be end with Below is the diagram showing different approach we discussed to set the intermediate complex optionals.
|
Another way of doing this is, move admin settings for Windows before the optional configurations as below:
|
_DefinitionCreatable_
_DefinitionLinuxCreatable_
_DefinitionWindowsCreatable_
_DefinitionWithMarketPlaceImage_
_DefinitionVMCreatable_
|
Beta2 released. |
This is a thread for discussing design of
withImage
,defineOSDisk
variants andwithExistingOSDisk
that needs to be enabled in VM fluent definition flow.The
withImage
variants allows basic user to easily declare the image to be used for the VM's OS Disk (with default configuration)The
defineOSDisk
variants allows user to declare the image along with OS disk configuration, such as caching, size, encryption settings etc..The
withExistingOSDisk
allows user to attach an existing OS Disk VHD for the VM.The text was updated successfully, but these errors were encountered: