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

add gVNIC support for compute instance #4443

Merged
merged 5 commits into from
Feb 9, 2021

Conversation

edwardmedia
Copy link
Contributor

@edwardmedia edwardmedia commented Jan 28, 2021

Fixes hashicorp/terraform-provider-google#7699

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

compute: added `nic_type` field to `google_compute_instance` resource to support gVNIC
compute: added `nic_type` field to `google_compute_instance_template ` resource to support gVNIC

@google-cla google-cla bot added the cla: yes label Jan 28, 2021
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@slevenick, please review this PR or find an appropriate assignee.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 4 files changed, 97 insertions(+))
Terraform Beta: Diff ( 4 files changed, 97 insertions(+))
TF Conversion: Diff ( 1 file changed, 2 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=169817"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 4 files changed, 97 insertions(+))
Terraform Beta: Diff ( 4 files changed, 97 insertions(+))
TF Conversion: Diff ( 1 file changed, 2 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=169925"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 4 files changed, 97 insertions(+))
Terraform Beta: Diff ( 4 files changed, 97 insertions(+))
TF Conversion: Diff ( 1 file changed, 2 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=170343"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceGoogleComputeInstanceGroup_fromIGM|TestAccInstanceTemplateDatasource_name|TestAccInstanceTemplateDatasource_filter|TestAccInstanceTemplateDatasource_filter_mostRecent|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccComputeAutoscaler_autoscalerBasicExample|TestAccComputeAutoscaler_autoscalerSingleInstanceExample|TestAccComputeAutoscaler_update|TestAccComputeAutoscaler_multicondition|TestAccComputeAutoscaler_scaleDownControl|TestAccComputeAutoscaler_scalingSchedule|TestAccComputeAutoscaler_scaleInControlFixed|TestAccComputeAutoscaler_scaleInControl|TestAccComputeBackendService_withBackend|TestAccComputeBackendService_withBackendAndMaxUtilization|TestAccComputeBackendService_withBackendAndIAP|TestAccComputeBackendService_withMaxConnections|TestAccComputeBackendService_withMaxConnectionsPerInstance|TestAccComputeBackendService_internalLoadBalancing|TestAccComputeForwardingRule_forwardingRuleHttpLbExample|TestAccComputeGlobalForwardingRule_globalForwardingRuleInternalExample|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccComputeInstanceFromTemplate_basic|TestAccComputeInstanceFromTemplate_overrideBootDisk|TestAccComputeInstanceFromTemplate_overrideAttachedDisk|TestAccComputeInstanceFromTemplate_overrideScratchDisk|TestAccComputeInstanceFromTemplate_overrideScheduling|TestAccComputeInstanceFromTemplate_overrideMetadataDotStartupScript|TestAccComputeInstanceFromTemplate_012_removableFields|TestAccInstanceGroupManager_basic|TestAccInstanceGroupManager_versions|TestAccInstanceGroupManager_targetSizeZero|TestAccInstanceGroupManager_update|TestAccInstanceGroupManager_autoHealingPolicies|TestAccInstanceGroupManager_stateful|TestAccComputeInstanceTemplate_imageShorthand|TestAccComputeInstanceTemplate_preemptible|TestAccComputeInstanceTemplate_networkTier|TestAccComputeInstanceTemplate_IP|TestAccComputeInstanceTemplate_basic|TestAccComputeInstanceTemplate_networkIP|TestAccComputeInstanceTemplate_networkIPAddress|TestAccComputeInstanceTemplate_disks|TestAccComputeInstanceTemplate_regionDisks|TestAccComputeInstanceTemplate_subnet_auto|TestAccComputeInstanceTemplate_primaryAliasIpRange|TestAccComputeInstanceTemplate_subnet_custom|TestAccComputeInstanceTemplate_secondaryAliasIpRange|TestAccComputeInstanceTemplate_metadata_startup_script|TestAccComputeInstanceTemplate_guestAccelerator|TestAccComputeInstanceTemplate_guestAcceleratorSkip|TestAccComputeInstanceTemplate_minCpuPlatform|TestAccComputeInstanceTemplate_soleTenantNodeAffinities|TestAccComputeInstanceTemplate_shieldedVmConfig1|TestAccComputeInstanceTemplate_EncryptKMS|TestAccComputeInstanceTemplate_ConfidentialInstanceConfigMain|TestAccComputeInstanceTemplate_shieldedVmConfig2|TestAccComputeInstanceTemplate_enableDisplay|TestAccComputeInstanceTemplate_withScratchDisk|TestAccComputeInstance_nictype_update|TestAccComputePerInstanceConfig_update|TestAccComputeRegionAutoscaler_regionAutoscalerBasicExample|TestAccComputeRegionAutoscaler_update|TestAccComputeRegionAutoscaler_scaleDownControl|TestAccComputeRegionAutoscaler_scalingSchedule|TestAccComputeRegionAutoscaler_scaleInControl|TestAccComputeRegionBackendService_regionBackendServiceBalancingModeExample|TestAccComputeRegionBackendService_withBackendMultiNic|TestAccComputeRegionBackendService_withBackendInternal|TestAccComputeRegionBackendService_withBackendInternalManaged|TestAccRegionInstanceGroupManager_basic|TestAccRegionInstanceGroupManager_update|TestAccRegionInstanceGroupManager_targetSizeZero|TestAccRegionInstanceGroupManager_versions|TestAccRegionInstanceGroupManager_autoHealingPolicies|TestAccRegionInstanceGroupManager_distributionPolicy|TestAccRegionInstanceGroupManager_stateful|TestAccComputeRegionPerInstanceConfig_update|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityCmekExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=170344"

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 4 files changed, 97 insertions(+))
Terraform Beta: Diff ( 4 files changed, 97 insertions(+))
TF Conversion: Diff ( 1 file changed, 2 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=170352"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceGoogleComputeInstanceGroup_fromIGM|TestAccInstanceTemplateDatasource_name|TestAccInstanceTemplateDatasource_filter|TestAccInstanceTemplateDatasource_filter_mostRecent|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccComputeAutoscaler_autoscalerSingleInstanceExample|TestAccComputeAutoscaler_update|TestAccComputeAutoscaler_autoscalerBasicExample|TestAccComputeAutoscaler_multicondition|TestAccComputeAutoscaler_scaleDownControl|TestAccComputeAutoscaler_scaleInControl|TestAccComputeAutoscaler_scaleInControlFixed|TestAccComputeAutoscaler_scalingSchedule|TestAccComputeBackendService_withBackend|TestAccComputeBackendService_withBackendAndMaxUtilization|TestAccComputeBackendService_withBackendAndIAP|TestAccComputeBackendService_withMaxConnections|TestAccComputeBackendService_withMaxConnectionsPerInstance|TestAccComputeBackendService_internalLoadBalancing|TestAccComputeForwardingRule_forwardingRuleHttpLbExample|TestAccComputeGlobalForwardingRule_globalForwardingRuleInternalExample|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccComputeInstanceFromTemplate_basic|TestAccComputeInstanceFromTemplate_overrideBootDisk|TestAccComputeInstanceFromTemplate_overrideAttachedDisk|TestAccComputeInstanceFromTemplate_overrideScratchDisk|TestAccComputeInstanceFromTemplate_overrideScheduling|TestAccComputeInstanceFromTemplate_012_removableFields|TestAccComputeInstanceFromTemplate_overrideMetadataDotStartupScript|TestAccInstanceGroupManager_update|TestAccInstanceGroupManager_targetSizeZero|TestAccInstanceGroupManager_basic|TestAccInstanceGroupManager_autoHealingPolicies|TestAccInstanceGroupManager_stateful|TestAccInstanceGroupManager_versions|TestAccComputeInstanceTemplate_basic|TestAccComputeInstanceTemplate_imageShorthand|TestAccComputeInstanceTemplate_preemptible|TestAccComputeInstanceTemplate_networkTier|TestAccComputeInstanceTemplate_IP|TestAccComputeInstanceTemplate_networkIPAddress|TestAccComputeInstanceTemplate_disks|TestAccComputeInstanceTemplate_networkIP|TestAccComputeInstanceTemplate_regionDisks|TestAccComputeInstanceTemplate_subnet_custom|TestAccComputeInstanceTemplate_subnet_auto|TestAccComputeInstanceTemplate_metadata_startup_script|TestAccComputeInstanceTemplate_primaryAliasIpRange|TestAccComputeInstanceTemplate_secondaryAliasIpRange|TestAccComputeInstanceTemplate_guestAccelerator|TestAccComputeInstanceTemplate_guestAcceleratorSkip|TestAccComputeInstanceTemplate_minCpuPlatform|TestAccComputeInstanceTemplate_soleTenantNodeAffinities|TestAccComputeInstanceTemplate_shieldedVmConfig2|TestAccComputeInstanceTemplate_EncryptKMS|TestAccComputeInstanceTemplate_shieldedVmConfig1|TestAccComputeInstanceTemplate_ConfidentialInstanceConfigMain|TestAccComputeInstanceTemplate_enableDisplay|TestAccComputeInstanceTemplate_withScratchDisk|TestAccComputePerInstanceConfig_update|TestAccComputeRegionAutoscaler_update|TestAccComputeRegionAutoscaler_regionAutoscalerBasicExample|TestAccComputeRegionAutoscaler_scaleDownControl|TestAccComputeRegionAutoscaler_scalingSchedule|TestAccComputeRegionAutoscaler_scaleInControl|TestAccComputeRegionBackendService_regionBackendServiceBalancingModeExample|TestAccComputeRegionBackendService_withBackendInternal|TestAccComputeRegionBackendService_withBackendMultiNic|TestAccComputeRegionBackendService_withBackendInternalManaged|TestAccRegionInstanceGroupManager_targetSizeZero|TestAccRegionInstanceGroupManager_basic|TestAccRegionInstanceGroupManager_update|TestAccRegionInstanceGroupManager_autoHealingPolicies|TestAccRegionInstanceGroupManager_distributionPolicy|TestAccRegionInstanceGroupManager_stateful|TestAccRegionInstanceGroupManager_versions|TestAccComputeRegionPerInstanceConfig_update|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityCmekExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=170445"

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Seeing lots of failures on:

panic: interface conversion: interface {} is nil, not string
goroutine 258 [running]:
github.com/hashicorp/terraform-provider-google-beta/v3/google-beta.expandNetworkInterfaces(0x3bbcb40, 0xc001049500, 0xc000753800, 0x0, 0x0, 0x0, 0x0, 0x0)
  /terraform-provider-google-beta/google-beta/compute_instance_helpers.go:253 +0xc82

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 6 files changed, 115 insertions(+))
Terraform Beta: Diff ( 7 files changed, 116 insertions(+), 1 deletion(-))
TF Conversion: Diff ( 1 file changed, 9 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=171308"

@edwardmedia edwardmedia requested a review from slevenick February 7, 2021 07:34
@slevenick
Copy link
Contributor

Is this feature GA? It looks to be beta based on the docs page: https://cloud.google.com/compute/docs/instances/create-vm-with-gvnic

We will probably need to put this behind version tags, similar to min_node_cpus

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 6 files changed, 115 insertions(+))
Terraform Beta: Diff ( 6 files changed, 115 insertions(+))
TF Conversion: Diff ( 1 file changed, 9 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=171476"

@edwardmedia edwardmedia requested review from slevenick and removed request for slevenick February 8, 2021 22:04
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 4 files changed, 6 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 111 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=171484"

@edwardmedia edwardmedia requested a review from slevenick February 9, 2021 00:49
Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Looks good!

Only note would be to mark the field as Beta only in the documentation

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 4 files changed, 6 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 111 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=171619"

@edwardmedia edwardmedia requested a review from slevenick February 9, 2021 16:24
@rileykarson
Copy link
Member

Quick note- I beleive the feature is now GA, as the addition of the instance field was an API change going from beta -> GA. Edward, if you have the time can you see if it works when we un-beta-guard all the gvnic stuff?

venkykuberan pushed a commit to venkykuberan/magic-modules that referenced this pull request Feb 11, 2021
* add gVNIC support for compute instance

* add google_compute_instance_template & fix a panic

* Using a func to replace inline code

* add ga filter

* add beta in documents
@ericyz
Copy link
Contributor

ericyz commented Mar 15, 2021

Hi @edwardmedia , I might need to pick up your brain on the downstream module used by terraform-validator. It seems there is a conversion error caused by

NicType: expandNicType(data["nic_type"].(interface{})),

Do you have any suggestion on how to fix it? Thanks.

CB Build Log: https://console.cloud.google.com/cloud-build/builds/1856bf87-0ce6-493b-b612-56fd3b1ef1f7?project=2843445864

@rileykarson
Copy link
Member

fyi @melinath

@melinath
Copy link
Member

Thanks Riley - I left a comment on GoogleCloudPlatform/terraform-validator#195 regarding this. But it looks like this is a beta-only field :-/ that's interesting! I'll take a look.

@melinath
Copy link
Member

melinath commented Mar 15, 2021

Ah yeah it was moved to GA in #4516 so my comment on the tfv PR should be correct :-) The comment on the PR was not correct. I've added some updates there.

melinath added a commit to GoogleCloudPlatform/terraform-validator that referenced this pull request Mar 17, 2021
We need to upgrade terraform-provider-google because we need the schema changes introduced in GoogleCloudPlatform/magic-modules#4443.

Changing to a specific commit is necessary because terraform-provider-google releases are no longer importable as go modules by default. See hashicorp/terraform-provider-google#8538 for the reasoning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Google Virtual Network Interface (gVNIC)
6 participants