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

Vm disk feature #412

Merged
merged 117 commits into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
6585559
Add missing file
vbauzys Jul 15, 2019
e247d25
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
vbauzys Jul 15, 2019
cf1e7c2
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Jul 23, 2019
be6790f
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
vbauzys Jul 24, 2019
6f4c5cb
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
vbauzys Jul 25, 2019
c73d402
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
vbauzys Jul 26, 2019
261d142
git push origin master
vbauzys Jul 29, 2019
c431d43
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Aug 1, 2019
414b3bf
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Aug 15, 2019
8b03ab8
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
vbauzys Aug 22, 2019
36c5487
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Sep 3, 2019
db01eec
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Sep 9, 2019
331e895
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Sep 12, 2019
a85d555
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Sep 19, 2019
e1996e3
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Sep 24, 2019
9c63eec
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
vbauzys Sep 27, 2019
5073f6c
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Oct 7, 2019
f0bdef3
git push origin master
vbauzys Oct 23, 2019
24f169d
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Oct 24, 2019
06b36d1
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Oct 24, 2019
30d6a79
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
vbauzys Oct 24, 2019
0ca001f
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Oct 24, 2019
8c9c7c4
git push origin master
vbauzys Oct 25, 2019
4c8d081
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Oct 30, 2019
206bc9f
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Oct 31, 2019
48970bc
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Nov 4, 2019
e7ef092
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Nov 7, 2019
cb5659a
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Nov 8, 2019
1e097fd
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Nov 11, 2019
ae2d955
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Nov 12, 2019
67f9230
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Nov 14, 2019
989c183
Draft version of last design
vbauzys Dec 2, 2019
4368664
Draft version of last design
vbauzys Dec 2, 2019
8a257d6
missing file
vbauzys Dec 2, 2019
5d82958
missing file
vbauzys Dec 2, 2019
ed2cf5d
missing file
vbauzys Dec 2, 2019
867b991
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Dec 2, 2019
b117594
Merge branch 'master' into vm-disk-feature
vbauzys Dec 2, 2019
2584e44
latest govcd with local changes
vbauzys Dec 2, 2019
6719df7
latest govcd with local changes
vbauzys Dec 2, 2019
f00f701
missing files
vbauzys Dec 3, 2019
4ecf4d3
Added computed structure for iternal disk, to be readable in state file
vbauzys Dec 3, 2019
b53ff76
Small improvements
vbauzys Dec 4, 2019
5da5f42
Added vm reboot support
vbauzys Dec 4, 2019
f611a02
Improve docs
vbauzys Dec 4, 2019
3d00b87
Added test for vm
vbauzys Dec 4, 2019
422b288
Added test for vm internal disk
vbauzys Dec 5, 2019
cde0d91
Add latest changes from govcd
vbauzys Dec 5, 2019
0ddb014
Improvements
vbauzys Dec 5, 2019
535b1ba
Add documentation
vbauzys Dec 5, 2019
993c1b7
Add documentation
vbauzys Dec 5, 2019
e2a282d
Update from latest govcd
vbauzys Dec 5, 2019
2e93c71
Fixes
vbauzys Dec 5, 2019
2243df6
Remove commented code
vbauzys Dec 5, 2019
f5a9047
Fix
vbauzys Dec 5, 2019
670d980
Add small fixes
vbauzys Dec 6, 2019
7ec2137
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Dec 6, 2019
e314843
Improve test, update according latest findings
vbauzys Dec 18, 2019
87c4fdb
Improve test, update according latest findings
vbauzys Dec 18, 2019
f36ba2c
Add VM status handling and changes according latest govcd
vbauzys Dec 19, 2019
4d2c5f4
Bom govcd version
vbauzys Dec 19, 2019
3f3798b
Merge
vbauzys Dec 19, 2019
ec131aa
git push origin masterMerge branch 'master' of github.com:terraform-p…
vbauzys Dec 19, 2019
b838db2
Merge branch 'master' into vm-disk-feature
vbauzys Dec 19, 2019
66ad708
Fix after merge
vbauzys Dec 19, 2019
9398399
Fix for vendor
vbauzys Dec 19, 2019
c29c06f
Improved doc
vbauzys Dec 20, 2019
7fe4e2f
Update changelog
vbauzys Dec 27, 2019
0ffff89
Improving test
vbauzys Jan 3, 2020
9024466
Comment out code
vbauzys Jan 6, 2020
7d87bcb
Increase version
vbauzys Jan 6, 2020
2dcdeae
Increase version
vbauzys Jan 6, 2020
84db69d
Increase version
vbauzys Jan 6, 2020
45fd197
Add sys check
vbauzys Jan 7, 2020
94703ff
Improved import handling org and vdc
vbauzys Jan 7, 2020
863eb45
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
vbauzys Jan 7, 2020
02319bc
Merge branch 'master' into vm-disk-feature
vbauzys Jan 7, 2020
3c736ab
upgrade govcd
vbauzys Jan 7, 2020
07aeb35
Improve unit tests
vbauzys Jan 7, 2020
f050743
Improve documentation
vbauzys Jan 7, 2020
d7468a7
Improve documentation
vbauzys Jan 7, 2020
c328f91
Improve documentation
vbauzys Jan 7, 2020
0782758
Add supress func for override_template_disk
vbauzys Jan 8, 2020
7895068
Reverted supress
vbauzys Jan 8, 2020
bd60379
Small improvements
vbauzys Jan 8, 2020
8de2600
Small improvement in doc
vbauzys Jan 8, 2020
4451115
Add improvements to doc
vbauzys Jan 8, 2020
97da6e4
Add improvements to doc
vbauzys Jan 8, 2020
ec0eac7
Removed thin provisioning from override template disk
vbauzys Jan 8, 2020
803f2a8
Changes for binary test to work
vbauzys Jan 9, 2020
734559a
Improve comments
vbauzys Jan 9, 2020
6643176
Improve docs
vbauzys Jan 9, 2020
54759fb
Improve docs
vbauzys Jan 9, 2020
35a9b08
Improve docs
vbauzys Jan 9, 2020
bc20d55
Improve comments
vbauzys Jan 9, 2020
d0b7480
Improve test
vbauzys Jan 9, 2020
8e95632
bum govcd version
vbauzys Jan 10, 2020
820c92e
Improve handling resource after import, now ignores allow_vm_reboot
vbauzys Jan 10, 2020
70d8e52
Improve vm status before handling
vbauzys Jan 10, 2020
55d6340
Change bus type validation setting, always accept low case
vbauzys Jan 10, 2020
5eb531b
Improve doc
vbauzys Jan 10, 2020
1c0d2d2
Improve doc
vbauzys Jan 10, 2020
757a03d
Improve doc
vbauzys Jan 10, 2020
30904da
Improve doc
vbauzys Jan 10, 2020
8e54b3e
Add filtering out independent disk from internal disks in listing and…
vbauzys Jan 10, 2020
0aa3325
Improve docs
vbauzys Jan 10, 2020
5615855
Improve test
vbauzys Jan 10, 2020
543bf7f
Add comments
vbauzys Jan 10, 2020
e7eaafe
Add missing element internal_disk to datasource
vbauzys Jan 13, 2020
584b615
Add missing attach independent disk in test
vbauzys Jan 13, 2020
f5f4d82
Improve comment
vbauzys Jan 13, 2020
624adf4
Removed not needed parts
vbauzys Jan 13, 2020
c238651
Improve docs
vbauzys Jan 13, 2020
a669fdd
Improvements
vbauzys Jan 13, 2020
36d7b90
Fix doc
vbauzys Jan 13, 2020
3b47d98
Improve doc
vbauzys Jan 13, 2020
a0e4aa3
bump govcd
vbauzys Jan 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## 2.7.0 (Unreleased)

FEATURES:

* **New Resource:** `vcd_vm_internal_disk` VM internal disk configuration
* `vcd_vapp_vm` Internal disks in VM template allows to be edited by `override_template_disk` field

NOTES:
* Drop support for vCD 9.0

Expand Down
2 changes: 1 addition & 1 deletion PREVIOUS_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.5.0
v2.6.0
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.6.0
v2.7.0
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ go 1.13
require (
github.com/hashicorp/go-version v1.2.0
github.com/hashicorp/terraform-plugin-sdk v1.3.0
github.com/vmware/go-vcloud-director/v2 v2.5.1
github.com/vmware/go-vcloud-director/v2 v2.6.0-alpha.1
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ github.com/vmihailenco/msgpack v3.3.3+incompatible h1:wapg9xDUZDzGCNFlwc5SqI1rvc
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU=
github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmware/go-vcloud-director/v2 v2.5.1 h1:VYZyhkLDbUNwDpSFp+b+6rCZ9/1Om2IORP01ExCHspU=
github.com/vmware/go-vcloud-director/v2 v2.5.1/go.mod h1:zjondbeyTfZlzhwxOzyF4K2sWWYgMEv5H91dp5dPbU8=
github.com/vmware/go-vcloud-director/v2 v2.6.0-alpha.1 h1:tplMa0oMs/qBviLsvrxszpQb0v5j7QO86wkOML5VqjQ=
github.com/vmware/go-vcloud-director/v2 v2.6.0-alpha.1/go.mod h1:zjondbeyTfZlzhwxOzyF4K2sWWYgMEv5H91dp5dPbU8=
github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
github.com/zclconf/go-cty v1.1.0 h1:uJwc9HiBOCpoKIObTQaLR+tsEXx1HBHnOsOOpcdhZgw=
github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
Expand Down
28 changes: 28 additions & 0 deletions vcd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,34 @@ func (cli *VCDClient) unLockParentVapp(d *schema.ResourceData) {
vcdMutexKV.Unlock(key)
}

// lockParentVm locks using vapp_name and vm_name names existing in resource parameters.
// Parent means the resource belongs to the VM being locked
func (cli *VCDClient) lockParentVm(d *schema.ResourceData) {
vappName := d.Get("vapp_name").(string)
if vappName == "" {
panic("vApp name not found")
}
vmName := d.Get("vm_name").(string)
if vmName == "" {
panic("vmName name not found")
}
key := fmt.Sprintf("org:%s|vdc:%s|vapp:%s|vm:%s", cli.getOrgName(d), cli.getVdcName(d), vappName, vmName)
vcdMutexKV.Lock(key)
}

func (cli *VCDClient) unLockParentVm(d *schema.ResourceData) {
vappName := d.Get("vapp_name").(string)
if vappName == "" {
panic("vApp name not found")
}
vmName := d.Get("vm_name").(string)
if vmName == "" {
panic("vmName name not found")
}
key := fmt.Sprintf("org:%s|vdc:%s|vapp:%s|vm:%s", cli.getOrgName(d), cli.getVdcName(d), vappName, vmName)
vcdMutexKV.Unlock(key)
}

// function lockParentEdgeGtw locks using edge_gateway name existing in resource parameters.
// Parent means the resource belongs to the edge gateway being locked
func (cli *VCDClient) lockParentEdgeGtw(d *schema.ResourceData) {
Expand Down
18 changes: 18 additions & 0 deletions vcd/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,3 +813,21 @@ func importStateIdEdgeGatewayObject(vcd TestConfig, edgeGatewayName, objectName
objectName, nil
}
}

// Used by all entities that depend on Org + VDC + vApp VM (such as VM internal disks)
func importStateIdVmObject(orgName, vdcName, vappName, vmName, objectIdentifier string) resource.ImportStateIdFunc {
return func(*terraform.State) (string, error) {
if orgName == "" || vdcName == "" || vappName == "" || vmName == "" || objectIdentifier == "" {
return "", fmt.Errorf("missing information to generate import path")
}
return orgName +
ImportSeparator +
vdcName +
ImportSeparator +
vappName +
ImportSeparator +
vmName +
ImportSeparator +
objectIdentifier, nil
}
}
47 changes: 47 additions & 0 deletions vcd/datasource_vcd_vapp_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,53 @@ func datasourceVcdVAppVm() *schema.Resource {
Computed: true,
Set: resourceVcdVmIndependentDiskHash,
},
"internal_disk": {
Type: schema.TypeList,
Computed: true,
Description: "A block will show internal disk details",
Elem: &schema.Resource{Schema: map[string]*schema.Schema{
"disk_id": {
Type: schema.TypeString,
Computed: true,
Description: "The disk ID.",
},
"bus_type": {
Type: schema.TypeString,
Computed: true,
Description: "The type of disk controller. Possible values: ide, parallel( LSI Logic Parallel SCSI), sas(LSI Logic SAS (SCSI)), paravirtual(Paravirtual (SCSI)), sata",
},
"size_in_mb": {
Type: schema.TypeInt,
Computed: true,
Description: "The size of the disk in MB.",
},
"bus_number": {
Type: schema.TypeInt,
Computed: true,
Description: "The number of the SCSI or IDE controller itself.",
},
"unit_number": {
Type: schema.TypeInt,
Computed: true,
Description: "The device number on the SCSI or IDE controller of the disk.",
},
"thin_provisioned": {
Type: schema.TypeBool,
Computed: true,
Description: "Specifies whether the disk storage is pre-allocated or allocated on demand.",
},
"iops": {
Type: schema.TypeInt,
Computed: true,
Description: "Specifies the IOPS for the disk. Default - 0.",
},
"storage_profile": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Storage profile to override the VM default one",
},
}},
},
"expose_hardware_virtualization": &schema.Schema{
Type: schema.TypeBool,
Computed: true,
Expand Down
1 change: 1 addition & 0 deletions vcd/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func Provider() terraform.ResourceProvider {
"vcd_nsxv_firewall_rule": resourceVcdNsxvFirewallRule(), // 2.5
"vcd_nsxv_dhcp_relay": resourceVcdNsxvDhcpRelay(), // 2.6
"vcd_nsxv_ip_set": resourceVcdIpSet(), // 2.6
"vcd_vm_internal_disk": resourceVmInternalDisk(), // 2.7
},

DataSourcesMap: map[string]*schema.Resource{
Expand Down
7 changes: 4 additions & 3 deletions vcd/resource_vcd_edgegateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func resourceVcdEdgeGatewayCreate(d *schema.ResourceData, meta interface{}) erro
}

// In version 9.7+ the advanced property is true by default
if vcdClient.APIVCDMaxVersionIs(">= 32.0") {
if vcdClient.Client.APIVCDMaxVersionIs(">= 32.0") {
if !d.Get("advanced").(bool) {
return fmt.Errorf("'advanced' property for vCD 9.7+ must be set to 'true'")
}
Expand Down Expand Up @@ -352,7 +352,7 @@ func resourceVcdEdgeGatewayCreate(d *schema.ResourceData, meta interface{}) erro
// vCD 9.0 does not support FIPS Mode and fails if XML tag <FipsModeEnabled> is sent therefore
// field value must be sent only if user specified its value
if fipsModeEnabled, ok := d.GetOkExists("fips_mode_enabled"); ok {
if vcdClient.APIVCDMaxVersionIs("<= 29.0") { // vCD 9.0 or less
if vcdClient.Client.APIVCDMaxVersionIs("<= 29.0") { // vCD 9.0 or less
return fmt.Errorf("ERROR! FIPS mode is only supported starting" +
" with vCD 9.1. Please do not set this field when using with vCD 9.0")
}
Expand Down Expand Up @@ -790,7 +790,8 @@ func getExternalNetworkData(vcdClient *VCDClient, d *schema.ResourceData, gatewa
// we check what the user has set in the config and passing through the same value.
// Note. If it wasn't "TypeSet" with more values - it would be possible to simply omit
// setting the field.
if vcdClient.APIVCDMaxVersionIs("<= 29") && origin == "resource" {
// "<= 29" -> if vCD older or 9.0
if vcdClient.Client.APIVCDMaxVersionIs("<= 29") && origin == "resource" {
log.Printf("[TRACE] edge gateway - skipping read of external networks on vCD 9.0 "+
"because for network %s it does not return these values", extNetwork.Network.Name)
stateGatewayInterfaces, _ := getGatewayInterfacesType(vcdClient, d.Get("external_network").(*schema.Set))
Expand Down
28 changes: 0 additions & 28 deletions vcd/resource_vcd_independent_disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ func TestAccVcdIndependentDiskBasic(t *testing.T) {

params["FuncName"] = t.Name() + "-Compatibility"
configTextForCompatibility := templateFill(testAccCheckVcdIndependentDiskForCompatibility, params)
/* params["FuncName"] = t.Name()
configText := templateFill(testAccCheckVcdIndependentDiskBasic, params)
*/
params["FuncName"] = t.Name() + "-WithoutOptionals"
configTextWithoutOptionals := templateFill(testAccCheckVcdIndependentDiskWithoutOptionals, params)

Expand All @@ -60,7 +57,6 @@ func TestAccVcdIndependentDiskBasic(t *testing.T) {
Config: configTextForCompatibility,
Check: resource.ComposeTestCheckFunc(
testAccCheckDiskCreated("vcd_independent_disk."+resourceName),
//resource.TestCheckResourceAttr("vcd_independent_disk."+resourceName, "size_in_bytes", "5242880000"),
resource.TestMatchResourceAttr("vcd_independent_disk."+resourceName, "owner_name", regexp.MustCompile(`^\S+`)),
resource.TestMatchResourceAttr("vcd_independent_disk."+resourceName, "datastore_name", regexp.MustCompile(`^\S+`)),
resource.TestMatchResourceAttr("vcd_independent_disk."+resourceName, "iops", regexp.MustCompile(`^\d+$`)),
Expand All @@ -74,17 +70,6 @@ func TestAccVcdIndependentDiskBasic(t *testing.T) {
ImportStateIdFunc: importStateIdByDisk("vcd_independent_disk." + resourceName),
ImportStateVerifyIgnore: []string{"org", "vdc", "size"},
},
/* resource.TestStep{
Config: configText,
Check: resource.ComposeTestCheckFunc(
testAccCheckDiskCreated("vcd_independent_disk."+resourceName+"second"),
resource.TestCheckResourceAttr("vcd_independent_disk."+resourceName+"second", "size_in_bytes", "5242880000"),
resource.TestMatchResourceAttr("vcd_independent_disk."+resourceName+"second", "owner_name", regexp.MustCompile(`^\S+`)),
resource.TestMatchResourceAttr("vcd_independent_disk."+resourceName+"second", "datastore_name", regexp.MustCompile(`^\S+`)),
resource.TestMatchResourceAttr("vcd_independent_disk."+resourceName+"second", "iops", regexp.MustCompile(`^\d+$`)),
resource.TestCheckResourceAttr("vcd_independent_disk."+resourceName+"second", "is_attached", "false"),
),
},*/
resource.TestStep{
Config: configTextWithoutOptionals,
Check: resource.ComposeTestCheckFunc(
Expand Down Expand Up @@ -192,16 +177,3 @@ resource "vcd_independent_disk" "{{.secondResourceName}}" {
size = "{{.size}}"
}
`

/*const testAccCheckVcdIndependentDiskBasic = `
resource "vcd_independent_disk" "{{.secondResourceName}}" {
org = "{{.Org}}"
vdc = "{{.Vdc}}"
name = "{{.secondName}}"
size_in_bytes = "{{.sizeInBytes}}"
bus_type = "{{.busType}}"
bus_sub_type = "{{.busSubType}}"
storage_profile = "{{.storageProfileName}}"
}
`
*/
3 changes: 2 additions & 1 deletion vcd/resource_vcd_nsxv_firewall_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ func resourceVcdNsxvFirewallRuleUpdate(d *schema.ResourceData, meta interface{})
// IP set IDs (ipset-454 insted of a0c3c92a-a180-48fb-96ec-91c610c7c254:ipset-460) for update
// operations only. Otherwise update operation fails with exception.
var shortIds bool
if vcdClient.APIVCDMaxVersionIs("<= 29") {
// if vCD older or 9.0
if vcdClient.Client.APIVCDMaxVersionIs("<= 29") {
log.Println("[DEBUG] vcd_nsxv_firewall_rule update - using short IDs for update operations because vCD is <= 9.0 ")
shortIds = true
}
Expand Down
3 changes: 2 additions & 1 deletion vcd/resource_vcd_nsxv_firewall_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,8 @@ func TestAccVcdNsxvEdgeFirewallRuleVms(t *testing.T) {
if err != nil {
t.Skip("unable to validate vCD version - skipping test")
}
if vcdClient.APIVCDMaxVersionIs("= 29.0") {
// if vCD older or 9.0
if vcdClient.Client.APIVCDMaxVersionIs("= 29.0") {
t.Skip("Skipping this test for vCD 9.0 because of a known issue: " +
"https://github.com/terraform-providers/terraform-provider-vcd/issues/420")
}
Expand Down
Loading