Giter VIP home page Giter VIP logo

terraform-provider-vmware's People

Contributors

maxmanuylov avatar mkuzmin avatar vladrassokhin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-provider-vmware's Issues

Being able to set custom attributes to VM

Not sure if Govmomi supports it, but we would like to be able to set some additional properties. For example, have a look at an example piece of a .vmx file on the ESX host in te /vmfs/volumes directory:

/vmfs/volumes/5486bf8c-adb425de-a078-6c3be5bda200/shd-lgc-proxy-001 # grep "machine\.id" shd-lgc-proxy-001.vmx

Result:

machine.id = "shd-lgc-proxy-001#shddmzams5-rhel64-template#shd-esx-005.bolcom.net"

As you can see the key "machine.id" is filled with some value. We use this value for PXE boot purposes. Do you think it's possible for terraform-vsphere to fill up these custom attributes?

not enough arguments in call to govmomi.NewClient

Not sure if this is something I'm doing wrong getting "not enough arguments in call to govmomi.NewClient"

possibly using the wrong version of govmomi?
I'm using windows to build the package if that helps

# github.com/mkuzmin/terraform-vsphere
GO\src\github.com\mkuzmin\terraform-vsphere\config.go:22: not enough arguments in call to govmomi.NewClient
GO\src\github.com\mkuzmin\terraform-vsphere\resource_virtual_machine.go:105: cannot use client (type *govmomi.Client) as type *vim25.Client in argument to find.
NewFinder
GO\src\github.com\mkuzmin\terraform-vsphere\resource_virtual_machine.go:106: not enough arguments in call to finder.DefaultDatacenter
GO\src\github.com\mkuzmin\terraform-vsphere\resource_virtual_machine.go:111: client.Properties undefined (type *govmomi.Client has no field or method Properties
)
GO\src\github.com\mkuzmin\terraform-vsphere\resource_virtual_machine.go:120: client.SearchIndex undefined (type *govmomi.Client has no field or method SearchInd
ex)
GO\src\github.com\mkuzmin\terraform-vsphere\resource_virtual_machine.go:130: client.Properties undefined (type *govmomi.Client has no field or method Properties
)
GO\src\github.com\mkuzmin\terraform-vsphere\resource_virtual_machine.go:135: undefined: govmomi.Reference
GO\src\github.com\mkuzmin\terraform-vsphere\resource_virtual_machine.go:136: undefined: govmomi.Folder
GO\src\github.com\mkuzmin\terraform-vsphere\resource_virtual_machine.go:138: client.SearchIndex undefined (type *govmomi.Client has no field or method SearchInd
ex)
GO\src\github.com\mkuzmin\terraform-vsphere\resource_virtual_machine.go:148: undefined: govmomi.NewFolder
GO\src\github.com\mkuzmin\terraform-vsphere\resource_virtual_machine.go:148: too many errors

D:\Provisioning>go get github.com/mkuzmin/terraform-vsphere

can not create a simple vm from an image

Hi,

Here my stack trace from terraform:


vsphere_virtual_machine.jenkins: Creating...
cpus: "" => "1"
datacenter: "" => ""
folder: "" => ""
host: "" => ""
image: "" => "bastion"
ip_address: "" => ""
linked_clone: "" => "0"
memory: "" => "1"
name: "" => "jenkins"
power_on: "" => "1"
resource_pool: "" => "respool1"
vsphere_virtual_machine.jenkins: Error: 1 error(s) occurred:

  • Unknown compute resource format of base VM: ha-compute-res
    Error applying plan:

1 error(s) occurred:

  • 1 error(s) occurred:
  • 1 error(s) occurred:
  • Unknown compute resource format of base VM: ha-compute-res

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error

above and apply again to incrementally change your infrastructure.

I use this simple config:

provider "vsphere" {
vcenter_server = "192.168.31.62:443"
user = "root"
password = "redacted"
insecure_connection = true
}
resource "vsphere_virtual_machine" "jenkins" {
name = "jenkins"
image = "bastion"
resource_pool = "respool1"
}

Any idea about this error message?

Thx

A specified parameter was not correct. spec.identity

Terraform creates the machine all the way to the ethernet interface correctly, but doesn't poweron the box and instead fails with the error in the title. I'm not sure what I'm doing wrong. The template I'm cloning from is Windows. There doesn't seem to be any log beyond this generic message. What can I do to troubleshoot this. Here's my terraform.tf:

provider "vsphere" {
user = ""
password = ""
vcenter_server = ""
}
resource "vsphere_virtual_machine" "inttstsqlv04" {
name = "inttstsqlv04"
domain = "nt.local"
time_zone = "America/Denver"
datacenter = "DC AF"
cluster = "BL460V2"
vcpu = 2
memory = 4096
disk {
datastore = "VNXLun122_R6NLSAS"
template = "TEMPLATES/Windows Server 2012 R2 Terraform Template"
}
network_interface {
label = "BO 10.122.12.x"
ip_address = "10.122.12.42"
subnet_mask = "255.255.255.0"
}
}

Error cloning VM: operation is not supported on the object

For some reason I cannot clone an existing VM. I have created a very simple virtual machine which I want to clone to another VM. My .tf file looks like this:

provider "vsphere" {
  # Variables VSPHERE_USER and VSPHERE_PASSWORD can also be environment variables.
  server = "vmware-hostnamet"
  user = "root"
  password = "bla"
}

resource "vsphere_virtual_machine" "machine" {
  name =  "dummy-vm"
  source = "dummy-vm"
  datacenter = "datacenter-poc"

### optional parameters
# if true, create a linked clone from a latest snapshot
# if false (default), create a full clone from a current state
  linked_clone = false
  power_on = false
}

The output of the terraform apply command is this:

vsphere_virtual_machine.machine: Creating...
cpus:         "" => "<computed>"
datacenter:   "" => "datacenter-poc"
folder:       "" => "<computed>"
host:         "" => "<computed>"
ip_address:   "" => "<computed>"
linked_clone: "" => "0"
memory:       "" => "<computed>"
name:         "" => "dummy-vm"
pool:         "" => "<computed>"
power_on:     "" => "0"
source:       "" => "dummy-vm"
vsphere_virtual_machine.machine: Error: Error clonning vm: The operation is not supported on the object.

What am I doing wrong? Please see below a screenshot of the task which is generated inside the vCenter web interface.

screen shot 2015-02-06 at 14 35 09

Create VM templates

Add an option to create a machine, add a snapshot, and convert it to a template (required for further linked clones)

Being able to alter hard disk size

It would be very useful is we could (optional) alter hard disk size. For example:

resource "vsphere_virtual_machine" "web" {
  name =  "bla"
  folder = "/linux"
  image = "/linux/dummy-vm"
  linked_clone = false
  cpus = 2
  memory = 4096
  power_on = false
  disk_size = 20480
}

Specify additional disks for VM

Hi,

first of all kudos for your great vsphere provider. I'm using it in my Cloud self service portal.
Works really good so far.

At the moment I'm working on this issue:

Is it possible to specify additional disks for a VM? I have seen some lines in the GO code.

Could you please provide a terraform example?
That would be great.

Thx.

Clone VM from a current state

At the moment a machine s cloned from latest snapshot.
Add a option to clone from a current state (not valid for linked clones)

Customize VM disks

  • Create a new disk
  • Attach an existing disk from datasotre
  • Resize current disk

Enhancement request : support for ESXi host and disk parameters

Hi,

I want to modify "terraform-provider-vsphere" provider to include 2 more fields while creating vms.

  1. Based on some ratio of vCPU available on ESXi servers on VCenter.
  2. Attaching disk based on "x" capacity availability.

These 2 parameters will be calculated at run time.(may be when we say terraform plan/ apply)

Please suggest the pointers for the same.
Thank you.

Ability to set a static IP address

Is it possible to set a static IP address? It looks like the ip_address config setting is only computed, which will work fine for DHCP type situations, but not for those needing to have static IPs assigned.

Specify how to obtain parameter values

I'm trying to use the plugin, but I'm having a hard time finding out what parameters I should use. F.e. "source". Is it the existing VM / template which I want to clone? How do I obtain the full value? What is a "pool" and how to find it's value. So a little more docs/info about what to use as parameters would be highly appreciated.

name =  "machine1"
source = "datacenter-poc/vm/dummy-vm"
datacenter = "datacenter-poc"
folder = "rogier-cloned-vm"
host = "rogier-hostname"
pool = "Resource/Pool"

Support configuration changes

At the moment the provider can create new VMs, but if Terraform state parameters are changed (i.e. machine is renamed), it cannot update properties of already running vm.

vsphere_virtual_machine.machine: Error: doesn't support update

Use guest customization specifications

At the moment guest customization is performed with a set of hard-coded parameters:

  • hostname is copied from VM name,
  • VM must have just one network adapter,
  • Network is configured for using DHCP.

Provide a setting to use external customization specs stored in vCenter.

(related issue: #2)

Cannot destroy disabled VMs

Commit bbb3f2e introduced a bug.
If VM is powered off, then terraform destroy fails, because WaitForResult() returns an error legitimately.

>terraform destroy -force test\1-empty
vmware_virtual_machine.vm: Refreshing state... (ID: vm-23)
vmware_virtual_machine.vm: Destroying... (ID: vm-23)
Error applying plan:
1 error(s) occurred:

* vmware_virtual_machine.vm (destroy): 1 error(s) occurred:
* vmware_virtual_machine.vm: Error powering vm off: The attempted operation cannot be performed in the current state (Powered off).

Cannot set custom VM parameters with dot-sign in a name

Something was changed in Terraform 0.5.
Configuration

  configuration_parameters = {
    isolation.tools.copy.disable = "false"
    isolation.tools.paste.disable = "false"
  }

produces this output:

vsphere_virtual_machine.vm: Creating...
  configuration_parameters.#:                             "" => "2"
  configuration_parameters.isolation.tools.copy.disable:  "" => ""
  configuration_parameters.isolation.tools.paste.disable: "" => ""

And parameters are not added.

But parameters without dot-sign are added correctly.

Crash due to main.providerMeta

Recent change e90ad49 introduced a bug:

>terraform apply test\1-empty
vmware_virtual_machine.vm: Creating...
1 error(s) occurred:
* vmware_virtual_machine.vm: unexpected EOF

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
anypanic: interface conversion: interface {} is main.providerMeta, not *main.providerMeta
2017/04/08 15:12:33 [DEBUG] plugin: terraform-provider-vmware.exe: 
2017/04/08 15:12:33 [DEBUG] plugin: terraform-provider-vmware.exe: goroutine 81 [running]:
2017/04/08 15:12:33 [DEBUG] plugin: terraform-provider-vmware.exe: main.resourceVirtualMachineCreate(0xc0423cebd0, 0xf9d660, 0xc042441f40, 0x0, 0x0)
2017/04/08 15:12:33 [DEBUG] plugin: terraform-provider-vmware.exe:      C:/Users/michael.kuzmin/Projects/go/src/github.com/mkuzmin/terraform-provider-vmware/resource_virt
ual_machine.go:112 +0x4115

Full log at https://gist.github.com/mkuzmin/d95d79c149d99674e892d0b665dfdccc

Cloning from template gives error

I'm trying to clone from a template, but it results in the error below. However I don't see the parameter "spec.location.pool" in the lost of possible params. What parameter is missing? And what value should it be set to? By the way: cloning from a virtual machine (instead of template) is working fine! Great work.

Error applying plan:

1 error(s) occurred:

* Error clonning vm: A specified parameter was not correct.
spec.location.pool

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Terraform plan throws an error

Hi,

I get following error while running plan.

terraform plan
There are warnings and/or errors related to your configuration. Please
fix these before continuing.

Errors:

  • provider.vsphere: Internal validation of the provider failed! This is always a bug
    with the provider itself, and not a user issue. Please report
    this bug:

vsphere_virtual_machine: No Update defined, must set ForceNew on: []string{"domain", "gateway", "power_on", "subnet_mask"}

Please have a look at it.
Thank you.

Regards,
Kanhaiya

* Cannot find resource pool

what do if your ESX Data Centre has no pools
it is clustered but no resource pools

not sure which value to use for resource_pool if no pool exists

thanks

Cloning to a different datastore

When target host does not have access to a datastore where source image is placed, Terraform fails with error like Unable to access the virtual machine configuration: Unable to access file [vm-Vagrant] ubuntu-SNAPSHOT/ubuntu-SNAPSHOT.vmtx.

Need to detect target datastore automatically, or specify it explicitly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.