Skip to content
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

Support for autoscale for HDInsight clusters #8104

Closed
wants to merge 30 commits into from

Conversation

kosinsky
Copy link
Contributor

@kosinsky kosinsky commented Aug 12, 2020

Adds autoscale (capacity and scheduled) support for HDInsight clusters. Following resources were updated :

  • azurerm_hdinsight_hadoop_cluster
  • azurerm_hdinsight_hbase_cluster (scheduled only)
  • azurerm_hdinsight_interactive_query_cluster
  • azurerm_hdinsight_spark_cluster

Others weren't modified, because:

  • Spark doesn't support autoscale
  • Storm and ML/RServer cluster types are deprecated and will retired at the end of 2020

Capacity based autoscale:

      autoscale {
        capacity {
          min_instance_count = 2
          max_instance_count = 3
        }
      }

Scheduled autoscale:

      autoscale {
        recurrence {
          timezone  = "Pacific Standard Time"          
          schedule {
            days      = ["Monday"]
            time      = "10:00"
            target_instance_count = 5
          }
          schedule {
            days      = ["Saturday", "Sunday"]
            time      = "10:00"
            target_instance_count = 3
          }
        }
      }

Tests:

make testacc TEST='./azurerm/internal/services/hdinsight/tests/' TESTARGS='-run=autoscale -parallel=3' TESTTIMEOUT='300m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test ./azurerm/internal/services/hdinsight/tests/ -v -run=autoscale -parallel=3 -timeout 300m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccAzureRMHDInsightHadoopCluster_autoscale
=== PAUSE TestAccAzureRMHDInsightHadoopCluster_autoscale
=== RUN   TestAccAzureRMHDInsightHBaseCluster_autoscale
=== PAUSE TestAccAzureRMHDInsightHBaseCluster_autoscale
=== RUN   TestAccAzureRMHDInsightInteractiveQueryCluster_autoscale
=== PAUSE TestAccAzureRMHDInsightInteractiveQueryCluster_autoscale
=== RUN   TestAccAzureRMHDInsightSparkCluster_autoscale
=== PAUSE TestAccAzureRMHDInsightSparkCluster_autoscale
=== CONT  TestAccAzureRMHDInsightHadoopCluster_autoscale
=== CONT  TestAccAzureRMHDInsightSparkCluster_autoscale
=== CONT  TestAccAzureRMHDInsightInteractiveQueryCluster_autoscale
--- PASS: TestAccAzureRMHDInsightInteractiveQueryCluster_autoscale (1480.93s)
=== CONT  TestAccAzureRMHDInsightHBaseCluster_autoscale
--- PASS: TestAccAzureRMHDInsightHadoopCluster_autoscale (1853.24s)
--- PASS: TestAccAzureRMHDInsightSparkCluster_autoscale (2087.36s)
--- PASS: TestAccAzureRMHDInsightHBaseCluster_autoscale (1318.89s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/hdinsight/tests     2800.965s

Fixes #6470

Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kosinsky

Thanks for this PR. It's looking good. We've done some refactor/tidying work that have moved some of the helper code around, so this will need a rebase (it should do so cleanly I think). There's one change I think will need to be made after that (commented below). Once that's done I'll run the CI tests and I think this should be fine as is. There's an additional question on the bug you mention which would be good to have an answer on.

Thanks again.

@kosinsky
Copy link
Contributor Author

Merge and post merge refactoring reactions are done. Please, take a look

@ghost ghost removed the waiting-response label Aug 26, 2020
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @kosinsky

Thanks for pushing those changes :)

I've taken a look through and left some comments inline but this is looking good - if we can fix up the comments then this should otherwise be good to merge 👍

Thanks!

azurerm/internal/services/hdinsight/hdinsight.go Outdated Show resolved Hide resolved
azurerm/internal/services/hdinsight/hdinsight.go Outdated Show resolved Hide resolved
azurerm/internal/services/hdinsight/hdinsight.go Outdated Show resolved Hide resolved
azurerm/internal/services/hdinsight/hdinsight.go Outdated Show resolved Hide resolved
website/docs/r/hdinsight_spark_cluster.html.markdown Outdated Show resolved Hide resolved
website/docs/r/hdinsight_spark_cluster.html.markdown Outdated Show resolved Hide resolved
@kosinsky
Copy link
Contributor Author

@tombuildsstuff @jackofallops I addressed your feedback. Sorry for delay.

@ghost ghost removed the waiting-response label Sep 23, 2020
@sseppola
Copy link

sseppola commented Nov 2, 2020

@kosinsky thank you for all this work! It's much appreciated.

In case this was drowned in other notifications and forgotten about I wanted to leave a comment in hope it attracts some attention to a nearly finished PR :)

@kosinsky
Copy link
Contributor Author

kosinsky commented Nov 2, 2020

@tombuildsstuff @jackofallops Could you take one more look? I addressed your feedback. Please, let me know if I missed something or you have additional one.

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kosinsky! I got a chance to look over this and it looks good! The only issue is that it's quite a bit behind...through no fault of your own. Once it's back up to speed, we can get it merged quickly.

@katbyte
Copy link
Collaborator

katbyte commented May 1, 2021

@kosinsky - going to close this for #11547 - Thanks for getting it started!

@katbyte katbyte closed this May 1, 2021
favoretti pushed a commit to gro1m/terraform-provider-azurerm that referenced this pull request May 26, 2021
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for autoscale for HDInsight clusters
6 participants