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

Cloning from a VM on AHV #35

Closed
JonKohler opened this issue Feb 26, 2019 · 4 comments · Fixed by #114
Closed

Cloning from a VM on AHV #35

JonKohler opened this issue Feb 26, 2019 · 4 comments · Fixed by #114

Comments

@JonKohler
Copy link
Collaborator

JonKohler commented Feb 26, 2019

Moving issue from old repo, here: #224

I am getting the following error while trying to clone from a VM

data.nutanix_virtual_machine.vmds: 1 error(s) occurred:

  • data.nutanix_virtual_machine.vmds: data.nutanix_virtual_machine.vmds: nutanix_guest_tools.is_reachable: '' expected type 'string', got unconvertible type 'bool'

Here is the terraform tf

data "nutanix_virtual_machine" "vmds" {
  #vm_id = "${data.vault_generic_secret.nutanixuuid.data["centosce7"]}"
  vm_id = "41e97c71-52b3-458a-8ca5-e0ea50b613dd" #you should set your vmID here
}

resource "nutanix_virtual_machine" "demo-01-web" {
  # General Information
  name                 = "demo-01-web"
  description          = "demo Frontend Web Server"
  num_vcpus_per_socket = 2
  num_sockets          = 1
  memory_size_mib      = 4096
  #power_state          = "ON"

  # What cluster will this VLAN live on?
  cluster_reference = {
    kind = "cluster"
    uuid = "${local.cluster1}"
  }

  # What networks will this be attached to?
  nic_list = [{
    # subnet_reference is saying, which VLAN/network do you want to attach here?
    subnet_reference = {
      kind = "subnet"
      uuid = "4b170678-3e31-408d-b825-65403041a51d"
    }

  #   ip_endpoint_list = {
  #     ip   = "${local.ip_haproxy}"
  #     type = "ASSIGNED"
  #   }
  }]

  # What disk/cdrom configuration will this have?
  disk_list = [{
    # data_source_reference in the Nutanix API refers to where the source for
    # the disk device will come from. Could be a clone of a different VM or a
    # image like we're doing here
    data_source_reference = [{
      kind = "image"
      uuid = "${data.nutanix_virtual_machine.vmds.disk_list.0.data_source_reference.uuid}"
    }]

    # defining an additional entry in the disk_list array will create another
    # disk in addition to the image we're showing off above.
  #  device_properties = [{
  #    device_type = "DISK"
  #  }]
  #  disk_size_mib = 5000
  }]
}

Expected behavior
A clear and concise description of what you expected to happen.

Logs
If you've got any logs/outputs, attach them

Versions (please complete the following information):

  • Centos 7.6
  • terraform -v
    Terraform v0.11.11
  • provider.nutanix v1.0.0
  • provider.vault v1.5.0
  • AHV 20170830.184
  • PC 5.9.2
@justinhauer
Copy link

@JonKohler were you ever able to resolve this issue? I am looking to clone an existing VM for use in my terraform code and would like to know if you did anything to get past the issue you had.

@JonKohler
Copy link
Collaborator Author

Hey Justin - sorry I didn't see this before, I haven't done anything with this issue as I'm not plugged into the terraform project any longer. ill ping the team internally

@PacoDw
Copy link
Contributor

PacoDw commented Apr 13, 2020

Hello,
I tested with the latest Nutanix version, and I didn't have any errors, also I added a test case to verify it, you can see it on the PR #114

Let me know if you have another comment or concern, thank you so much.

marinsalinas added a commit that referenced this issue May 17, 2020
Fix #35: Validated the terraform configuration
@marinsalinas
Copy link
Contributor

@justinhauer, this configuration was tested on the latest version of this provider (master) and seems to be fixed, this fix will be available in the next release, you can test it building the provider binary from the master, feel free to open a new issue if you are still having issues.
Thanks for your collaboration :)

yannickstruyf3 pushed a commit to yannickstruyf3/terraform-provider-nutanix that referenced this issue Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants