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

provider/vsphere: Change ip_address parameter for ipv6 support #4035

Merged
merged 1 commit into from
Dec 10, 2015

Conversation

tkak
Copy link
Contributor

@tkak tkak commented Nov 24, 2015

This is a proposal PR to fix #3957.

I'd like to split ip_address parameter to ipv4_address and ipv6_address to support IPv6 address. (But, current version can not configure IPv6 address, just only read IPv6 address.)
And I'm thinking about changing subnet_mask parameter to ipv4_prefix_length and ipv6_prefix_length to simplify a configuration file and the code.

Before:

resource "vsphere_virtual_machine" "foo" {
    name = "sample"
    datacenter = "foo-dc"
    cluster = "foo-cluster"
    vcpu = 2
    memory = 4096
    gateway = "10.71.128.254"
    network_interface {
        label = "foo-label"
        ip_address = "10.71.128.1"
        subnet_mask = "255.255.255.0"
    }
    disk {
        datastore = "foo-datastore"
        template = "foo-template"
    }
}

After:

resource "vsphere_virtual_machine" "foo" {
    name = "sample"
    datacenter = "foo-dc"
    cluster = "foo-cluster"
    vcpu = 2
    memory = 4096
    gateway = "10.71.128.254"
    network_interface {
        label = "foo-label"
        ipv4_address = "10.71.128.1"
        ipv4_prefix_length = 24
    }
    disk {
        datastore = "foo-datastore"
        template = "foo-template"
    }
}

Thanks!

@chrislovecnm
Copy link
Contributor

@tkai I like the design and the changes. LGTM

@phinze thoughts?

@phinze
Copy link
Contributor

phinze commented Dec 3, 2015

@tkak similar to how we did with the vcenter parameter, can we keep the old parameters as deprecated for a release so we don't break existing users config without warning them?

@tkak
Copy link
Contributor Author

tkak commented Dec 9, 2015

@phinze OK, I'll try to fix.

@tkak
Copy link
Contributor Author

tkak commented Dec 10, 2015

@phinze I tried to fix for the old parameters. Could you check that?

@@ -321,7 +361,7 @@ func resourceVSphereVirtualMachineCreate(d *schema.ResourceData, meta interface{
}
}

if _, ok := d.GetOk("network_interface.0.ip_address"); !ok {
if _, ok := d.GetOk("network_interface.0.ipv4_address"); !ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be accessing the internal storage format of network_interface, I'll follow up post-merge with a commit tweaking this and cc you so you can see what I mean. 👍

@phinze
Copy link
Contributor

phinze commented Dec 10, 2015

Looks good with one tweak I'll make on master. Thanks @tkak!

phinze added a commit that referenced this pull request Dec 10, 2015
provider/vsphere: Change ip_address parameter for ipv6 support
@phinze phinze merged commit 231f0cb into hashicorp:master Dec 10, 2015
@ghost
Copy link

ghost commented Apr 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 29, 2020
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.

vSphere provider ipv6 support
5 participants