Commit Graph

96 Commits

Author SHA1 Message Date
Davide Agnello dfe1cacc9e Adding 'detach_unknown_disks_on_delete' flag for VM resource
Optional, defaults to false.  If true, will detach disks not managed by
Terraform VM resource prior to VM deletion.

Issue: #8945
2016-09-26 18:16:02 -07:00
Dan Allegood 70589fff4d Standardizing datastore references to use builting Path func (#8075)
This is a fix to allow use of datastores that are part of a datastore
cluster using the syntax  <datastore cluster name>/<datastore name>
2016-08-16 08:58:22 +01:00
Kristinn Örn Sigurðsson 6aa3bb574a provider/vSphere: Fix for IPv6 only environment creation. (#7643)
The code only waited until one or more IPv4 interfaces came online.
If you only had IPv6 interfaces attached to your machine, then the
machine creation process would completely stall.
2016-08-15 11:43:54 -05:00
Dan Allegood f8ee778c3a Adding disk type of Thick Lazy (#7916) 2016-08-09 07:59:32 +12:00
James Nugent de822d909c Merge pull request #7952 from dagnello/vsphere-file-copy
vSphere file resource: extending functionality to copy files in vSphere
2016-08-05 10:59:30 -07:00
Davide Agnello 895383ac92 vSphere file resource: extending functionality to copy files in vSphere
* Enables copy of files within vSphere
* Can copy files between different datacenters and datastores
* Update can move uploaded or copied files between datacenters and datastores
* Preserves original functionality for backward compatibility
2016-08-04 13:49:28 -07:00
Dan Allegood ed77105822 Improved SCSI controller handling (#7908)
Govmomi tries to use the 7th slot in a scsi controller, which is not
allowed. This patch will appropriately select the slot to attach a disk
to as well as determine if a scsi controller is full.
2016-08-05 05:29:02 +10:00
Dan Allegood 4b9b42dbf0 Fixes the hasBootableVmdk flag when attaching multiple disks (#7804)
The hasBootableFlag logic had a bug where it would only be set properly
if the bootable disk was the last specified.  Adding some bool logic
resolves the issue.  Also adding check to ensure only one bootable disk
is given, and cleaning up a redundant var.
2016-07-27 00:25:56 +01:00
dkalleg 9cbdc80937 vSphere Provider - Fix destroy when vm is powered off or has networks (#7206)
This patch adds a wait when powering on a vm so setupVirtualMachine does
not return until the vm is actually powered on.  This allows other
functions to work off the assumption that the current state of the vm
is not in flux. During resourceVSphereVirtualMachineRead(), the wait for
IP would cause a hang for any VM with no network interfaces or for vms
that had been powered off for any reason.  This also means that the user
could not delete a vm with no network interfaces or that is powered off.
Checking power state before trying to check for network interfaces.
Resolves https://github.com/hashicorp/terraform/issues/7168
2016-07-12 09:05:02 +01:00
dkalleg 71c694cc5f Additional SCSI controller types support (#7525)
This allows the user to specify new controller types.  Before when
specifying 'scsi', govmomi defaults to lsilogic-parallel. This patch
allows the user to now specify 'scsi-lsi-parallel', 'scsi-buslogic',
scsi-paravirtual', and 'scsi-lsi-sas'. Resolves issue
https://github.com/hashicorp/terraform/issues/7202
2016-07-12 09:02:41 +01:00
stack72 c28b100233
provider/vsphere: Fix the `vsphere_virtual_machine` tests
The PR that was merged to add `keep_on_destroy` was showing a green
build so was merged but that build happened before another merge adding
another parameter to the tests

FYI @dkalleg - fixes #7169
2016-07-11 16:15:28 +01:00
Paul Stack 784a1060e9 Revert "Revert "Adding disk keep_on_remove support on delete case"" 2016-07-11 15:48:34 +01:00
Paul Stack d70b9d334b Revert "Adding disk keep_on_remove support on delete case" (#7572) 2016-07-11 00:50:09 +03:00
dkalleg 95c0a74df7 Adding disk keep_on_remove support on delete case (#7169)
This both fixes the keep_on_remove reference in the disk update case
as well as adds logic to safely eject disks in the destroy case.
2016-07-11 00:36:59 +03:00
Eloy Coto ab390359be Vsphere: Added uuid attributes (#4382) 2016-06-29 21:45:59 +01:00
dkalleg ab92fa4dff Refreshing devices list after adding a disk or cdrom controller (#7167)
Also taking out an unnecessary ForceNew on controller_type as well
as correcting a reference to controller_type in Update case.
2016-06-29 19:47:56 +01:00
Paul Stack c25eb9b4b8 provider/vsphere: Make `vsphere_virtual_machine` `product_key` optional (#7410)
Fixes #6690

Luckily, the code was already checking to see if the product_key was
specified
2016-06-29 19:37:04 +01:00
James Nugent df46af5b57 Merge pull request #7278 from hashicorp/vsphere-vm-migration
provider/vsphere: Add migration for `enable_disk_uuid` on `virtual_machine`
2016-06-23 11:03:58 +03:00
dkalleg 81673a27e7 Graceful read miss (#7220)
For both the file and virtual_disk resource, Stat is used during read,
but if Stat returns an error, read() will return that error. In doing
so, if a resource is deleted manually, the TF user would then not be
able to destroy the resource because the read would block the Delete()
call. With this patch, read() will only return an error if that error
is NOT a DatastoreNoSuchFileError.
2016-06-23 07:47:08 +01:00
stack72 74ea8697de provider/vsphere: Add migration for `enable_disk_uuid` on
`virtual_machine`

Fixes #7275 - a state migration was missed when `enable_disk_uuid` was
merged

```
make testacc TEST=./builtin/providers/vsphere
TESTARGS='-run=TestVSphereVirtualMachineMigrateState'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/vsphere -v
-run=TestVSphereVirtualMachineMigrateState -timeout 120m
=== RUN   TestVSphereVirtualMachineMigrateState
--- PASS: TestVSphereVirtualMachineMigrateState (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/vsphere
0.018s
```
2016-06-22 23:43:44 +01:00
dkalleg fb6f2bc750 provider/vSphere - Add DiskEnableUUID option (#7088)
Since the custom_configuration_parameters can't take dots, we cannot
set 'disk.EnableUUID'.  This adds a parameter for this options that gets
added to a configSpec. This option causes the vm to mount disks by uuid
on the guest OS.
2016-06-09 10:19:10 +02:00
Mark Peek 74d5db4f3e Don't require vsphere debug paths to be set (#7027)
The change to add govmomi debug paths (#6893) required user input even
when the env was not set. This change defaults those values appropriately.
2016-06-07 16:16:04 +01:00
Mark Peek 57e935755e Add vsphere virtual machine migration (Fixes #7008) (#7023)
Fixes vsphere virtual machine migration issues with
disk controller_type and skip_customization.
2016-06-07 16:11:35 +01:00
Chris Love 7b449b66a0 Adding Govomi Debug Logging Capability and refactoring of integration tests (#6893)
* Adding debug functionality to log debug api calls

* adding debug and refactoring tests

* more tweaks with tests

* updating documentation

* more refactoring of tests

* working through factor for testing

* removing logging that displays username and password

* more work on getting tests stable
2016-06-02 20:15:01 +01:00
thetuxkeeper 2e49042d10 added mac address parameter (#6966) 2016-06-02 00:38:56 +01:00
dkalleg 1178293a54 Adding controller creation logic (#6853)
If a scsi or ide controller does not exist at the time a new disk
or cdrom needs it, we need to add that controller to the vm.
2016-06-01 00:03:33 +01:00
dkalleg a47ad103e2 Adding volume resource creation to vSphere provider (#6273)
Allows the user to create a vmdk in vSphere to the given path. In the
future this could support updates for rename and move.
2016-05-25 11:21:16 +01:00
dkalleg a6a6352759 vSphere virtual machine update disk (#6619)
Changed schema type for disks to support dynamic non-ordered disk
swapping.  All Disk attributes have been made non ForceNew since
any changes should be handled in the upgrade() function.
Added 'name' attribute to disks to act as a unique
identifier for when users request for new disks. It is also used as
the filename for the new disk. Templates are considered immutable.
2016-05-23 22:37:06 +01:00
dkalleg c34ea953b0 provider/vSphere Disk Controller Type (#6785)
Gives the user the ability to specify the controller type they would
like to connect their disk to.  Supported options are scsi and ide.
2016-05-21 07:21:42 +01:00
thetuxkeeper 62639620e1 merged createVirtualMachine and deployVirtualMachine to setupVirtualMachine (#6659) 2016-05-17 22:18:35 +01:00
thetuxkeeper 790115fe43 provider/vsphere: wait for network enhanced (#6377)
* - use WaitForNetIP
- removed duplicate wait for network parts

* gofmt fix

* fixes
2016-05-17 19:35:06 +01:00
thetuxkeeper 279eead08e disable unsupported customization parameters (#6656) 2016-05-13 15:56:15 +01:00
thetuxkeeper 390b0d5ab9 provider/vsphere: govmomi v0.6.1 update and fixes (#6479)
* vendor: Update dependency vmware/govmomi

* fixed data types

* fixed RemoveDevice

* fixed CreateDisk usage
2016-05-13 15:27:45 +01:00
thetuxkeeper 510b2934f0 fix gateway for dhcp (#6635) 2016-05-12 13:54:29 +01:00
thetuxkeeper 5984f84c12 provider/vsphere: read gateway and ipv6_gateway
read gateway and ipv6_gateway information for vsphere_virtual_machine resources.
2016-05-11 11:21:54 -04:00
thetuxkeeper 83f87e3741 fixed ipv6 - changed to Computed like ipv4 (#6480) 2016-05-05 15:38:45 +01:00
stumbaumr 207fa068c6 Fixed obvious typos 2016-05-04 21:07:48 +02:00
Daniel 5182bf6338 missing memory reservation in deployVirtualMachine 2016-05-04 18:53:44 +02:00
Paul Stack 501c05d0f7 provider/vsphere: IPv6 support. (#6457)
IPv6 support added.

We support 1 IPv6 address per interface. It seems like the vSphere SDK supports more than one, since it's provided as a list.
I can change it to support more than one address. I decided to stick with one for now since that's how the configuration parameters
had been set up by other developers.

The global gateway configuration option has been removed. Instead the user should specify a gateway on NIC level (ipv4_gateway and ipv6_gateway).

For now, the global gateway will be used as a fallback for every NICs ipv4_gateway.
The global gateway configuration option has been marked as deprecated.
2016-05-03 18:27:24 +02:00
thetuxkeeper bb73c74414 provider/vsphere: added update function with support for vcpu and memory (#6356)
* added update function with support for vcpu and memory

* waiting for vmware tools redundant with WaitForIP

* proper error handling of PowerOn task

* added test cases for update memory and vcpu

* reboot flag
2016-05-03 17:58:33 +02:00
Davide Agnello e086f6d754 Adding File Resource for vSphere provider
* Adding File Resource for vSphere provider

Allows for file upload to vSphere at specified location.  This also
includes update for moving or renaming of file resources.

* Ensuring required parameters are provided
2016-05-02 22:25:35 +02:00
James Nugent 9c85c2ed47 Merge pull request #6355 from godmodelabs/vsphere-disable-customization
provider/vsphere: Add setting to skip customization
2016-04-29 13:06:02 -05:00
dkalleg 6e5da78f79 Fixing hard disk path when specifying only size (#6400)
We were passing in a disk path of `[datastore] `, which the createDisk
call would create a file named `.vmdk` on the datastore, which is not
the expected behavior.  This make sure that if the user did not pass in
a vmdk path, that we call CreateDisk with an empty string like it
expects.
2016-04-29 00:44:30 +01:00
Daniel 5dbc4687a3 added skip_customization setting 2016-04-28 14:36:25 +02:00
dkalleg 6f62248471 Add functionality to specify and mount vmdks (#6146)
User may specify a vmdk in their disk definition.
The options size, template, and vmdk are considered
to be mutually exclusive. User may also set whether each disk
associated with the vm should try to boot after creation.
Todo: Enforce mutual exclusivity, validate the bootable_vmdk_path
2016-04-27 17:22:22 +01:00
Milan Karalic bff9e78ff9 Initial role documentation (#6302)
Updating links to the official doc
Fixing typo in VMware corp name
2016-04-26 00:14:11 +01:00
Takaaki Furukawa a9a607d67f provider/vsphere: Add support for memory reservation (#6036) 2016-04-25 12:15:37 +01:00
Paul Stack e213839e58 provider/vsphere: Fix missing ssh connection info (#6293) 2016-04-22 00:07:52 +01:00
James Nugent 5b1b49e2b7 Merge pull request #4243 from kristinn/vsphere-cdrom-support
vSphere: Support mounting ISO images to virtual cdrom drives.
2016-04-21 15:50:12 -07:00
aheeren db558ddc6b Checking for powered off state before deletion (#6283) 2016-04-21 17:27:36 +01:00