-
Notifications
You must be signed in to change notification settings - Fork 156
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
Vm priority and spot instance settings #894
Vm priority and spot instance settings #894
Conversation
@isaacabraham @ninjarobot |
else this.Identity.ToArmJson | ||
properties = | ||
{| hardwareProfile = {| vmSize = this.Size.ArmValue |} | ||
let properties = |
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.
Implemented this way because ARM chokes on any priority setting than Spot
if evictionPolicy
or billingProfile
are included.
@@ -7,7 +7,7 @@ open Farmer.Vm | |||
open System | |||
open System.Text | |||
|
|||
let virtualMachines = ResourceType ("Microsoft.Compute/virtualMachines", "2018-10-01") | |||
let virtualMachines = ResourceType ("Microsoft.Compute/virtualMachines", "2019-03-01") |
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.
Version 2019-03-01 is the oldest version to support the spot instance properties.
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.
Thanks for contributing this Jon! I have a couple small suggestions where I commented in the code. As for unit testing, it would be helpful to add a test that the logic around the priority and billing profile holds up even if both priority and spot_instance are set, regardless of order.
@bigjonroberts it might simplify to take out |
@ninjarobot I think my latest design change addresses this concern in the correct way. It's covered with tests now, too. Take a look at the last commit and see if you agree. |
Yes, cutting it down to a single field simplifies the state to check, and validation messages look great. Thanks for also adding tests to cover that logic. |
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.
Thanks again for the contribution!
Thanks for the contribution, this is released in farmer 1.6.30. |
The changes in this PR are as follows:
I have read the contributing guidelines and have completed the following:
Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure: