Commit Graph

67 Commits (9b640838a5f5e28db1c1f084afa393fa0b6d1166)

Author SHA1 Message Date
divyenpatel cdb48fb6a0 adding e2e test for storage class diskformat verification
adding govmomi dep to test/e2e/BUILD
adding golang.org/x/net/context to e2e deps
addressed review comments
addressed 2nd round of review comments

addressed review comments regarding KubeDescribe tagging
2017-02-14 21:08:53 -08:00
Kubernetes Submit Queue 93bd6b3b9f Merge pull request #40892 from hpcloud/vsphere_findbyuuid
Automatic merge from submit-queue (batch tested with PRs 41223, 40892, 41220, 41207, 41242)

Fixes #40819 and Fixes #33114

**What this PR does / why we need it**:

Start looking up the virtual machine by it's UUID in vSphere again. Looking up by IP address is problematic and can either not return a VM entirely, or could return the wrong VM.

Retrieves the VM's UUID in one of two methods - either by a `vm-uuid` entry in the cloud config file on the VM, or via sysfs. The sysfs route requires root access, but restores the previous functionality.

Multiple VMs in a vCenter cluster can share an IP address - for example, if you have multiple VM networks, but they're all isolated and use the same address range. Additionally, flannel network address ranges can overlap.

vSphere seems to have a limitation of reporting no more than 16 interfaces from a virtual machine, so it's possible that the IP address list on a VM is completely untrustworthy anyhow - it can either be empty (because the 16 interfaces it found were veth interfaces with no IP address), or it can report the flannel IP.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Fixes #40819
Fixes #33114

**Special notes for your reviewer**:

**Release note**:

```release-note
Reverts to looking up the current VM in vSphere using the machine's UUID, either obtained via sysfs or via the `vm-uuid` parameter in the cloud configuration file.
```
2017-02-10 13:35:42 -08:00
Robert Roland 53a009302a Fixes #40819
Start looking up the virtual machine by it's UUID in vSphere again. Looking up by IP address is problematic and can either not return a VM entirely, or could return the wrong VM.

Retrieves the VM's UUID in one of two methods - either by a `vm-uuid` entry in the cloud config file on the VM, or via sysfs. The sysfs route requires root access, but restores the previous functionality.

Multiple VMs in a vCenter cluster can share an IP address - for example, if you have multiple VM networks, but they're all isolated and use the same address range. Additionally, flannel network address ranges can overlap.

vSphere seems to have a limitation of reporting no more than 16 interfaces from a virtual machine, so it's possible that the IP address list on a VM is completely untrustworthy anyhow - it can either be empty (because the 16 interfaces it found were veth interfaces with no IP address), or it can report the flannel IP.
2017-02-09 22:55:37 -08:00
Kubernetes Submit Queue 052f3b9d4c Merge pull request #40118 from vmware/FixdetachVolumeOnNodeOff
Automatic merge from submit-queue (batch tested with PRs 41037, 40118, 40959, 41084, 41092)

Fix for detach volume when node is not present/ powered off

Fixes #33061 
When a vm is reported as no longer present in cloud provider and is deleted by node controller, there are no attempts to detach respective volumes. For example, if a VM is powered off or paused, and pods are migrated to other nodes. In the case of vSphere, the VM cannot be started again because the VM still holds mount points to volumes that are now mounted to other VMs.

In order to re-join this node again, you will have to manually detach these volumes from the powered off vm before starting it.

The current fix will make sure the mount points are deleted when the VM is powered off. Since all the mount points are deleted, the VM can be powered on again.

This is a workaround proposal only. I still don't see the kubernetes issuing a detach request to the vsphere cloud provider which should be the case. (Details in original issue #33061 )

@luomiao @kerneltime @pdhamdhere @jingxu97 @saad-ali
2017-02-09 16:44:40 -08:00
Balu Dontu 9fe3cf9ec3 Fix for detach volume when node is not present/ powered off 2017-02-07 13:36:36 -08:00
divyenpatel 7b17f91867 updating existing e2e tests and adding new e2e tests for vsphere cloud provider
addressed review comments

Addressed review comment for pv_reclaimpolicy.go to verify content of the volume

addressed 2nd round of review comments

addressed 3rd round of review comments from jeffvance
2017-02-07 10:36:39 -08:00
divyenpatel 7baa1c7365 fix for vSphere DeleteVolume 2017-01-26 10:25:07 -08:00
Antoine Pelisse ca964a1872 Update OWNERS approvers and reviewers: pkg/cloudprovider 2017-01-17 13:42:07 -08:00
deads2k 8686d67c80 move pkg/util/rand 2017-01-16 16:04:03 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Kubernetes Submit Queue 9484212b00 Merge pull request #38426 from abrarshivani/fix_lsi_logic_sas_bug
Automatic merge from submit-queue

Changed default scsi controller type in vSphere Cloud Provider

This PR changes default scsi controller to ```pvscsi``` in vSphere Cloud Provider. Fixes #37527
2016-12-19 18:08:58 -08:00
Kubernetes Submit Queue 8abbedae54 Merge pull request #38315 from mikedanese/pin-gazel
Automatic merge from submit-queue

Pin gazel to a version and support cgo

This fixes the bazel build.

@krousey who is buildcop
2016-12-12 19:32:29 -08:00
Kubernetes Submit Queue 6c059cb9a1 Merge pull request #36169 from hpcloud/vsphere_bad_conditional
Automatic merge from submit-queue

Bad conditional in vSphereLogin function

```release-note
Fixes NotAuthenticated errors that appear in the kubelet and kube-controller-manager due to never logging in to vSphere
```

With this conditional being == instead of !=, a login would never actually be attempted by this provider, and disk attachments would fail with a NotAuthenticated error from vSphere.
2016-12-12 18:51:21 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Angus Lees 8a7e103191 providers: Remove long-deprecated Instances.List()
This method has been unused by k8s for some time, and yet is the last
piece of the cloud provider API that encourages provider names to be
human-friendly strings (this method applies a regex to instance names).

Actually removing this deprecated method is part of a long effort to
migrate from instance names to instance IDs in at least the OpenStack
provider plugin.
2016-12-10 22:36:12 +11:00
Ritesh H Shukla 5e376fe5f9 Fix panic in vSphere cloud provider. Fixes #36295 2016-12-09 07:33:10 +00:00
Abrar Shivani e9e5f87d65 Changed default scsi controller type 2016-12-08 14:25:40 -08:00
Kubernetes Submit Queue 2c7e1317f4 Merge pull request #36724 from YuPengZTE/devCtx
Automatic merge from submit-queue (batch tested with PRs 36543, 38189, 38289, 38291, 36724)

context.Context should be the first parameter of a function in vsphere

**What this PR does / why we need it**:
Change the position of the context.Context parameter.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:
golint
**Release note**:

```release-note
```

Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-12-07 11:40:21 -08:00
Robert Roland 2cb5b5ec0e Applying changes per PR feedback -
Check for error conditions from the vSphere API and return the err if one occurs. The vSphere API does not return an err for unauthenticated users, it just returns a nil user object.
2016-12-06 13:12:49 -08:00
Chao Xu bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu c962c2602a dependencies: pkg/cloudprovider 2016-11-23 15:53:09 -08:00
yupeng fcca86d875 context.Context should be the first parameter of a function in vsphere
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2016-11-18 10:09:49 +08:00
Robert Roland 16226c0e18 Bad conditional in vSphereLogin function
With this conditional being == instead of !=, a login would never actually be attempted by this provider, and disk attachments would fail.
2016-11-03 09:12:28 -07:00
Jing Xu abbde43374 Add sync state loop in master's volume reconciler
At master volume reconciler, the information about which volumes are
attached to nodes is cached in actual state of world. However, this
information might be out of date in case that node is terminated (volume
is detached automatically). In this situation, reconciler assume volume
is still attached and will not issue attach operation when node comes
back. Pods created on those nodes will fail to mount.

This PR adds the logic to periodically sync up the truth for attached volumes kept in the actual state cache. If the volume is no longer attached to the node, the actual state will be updated to reflect the truth. In turn, reconciler will take actions if needed.

To avoid issuing many concurrent operations on cloud provider, this PR
tries to add batch operation to check whether a list of volumes are
attached to the node instead of one request per volume.

More details are explained in PR #33760
2016-10-28 09:24:53 -07:00
Mike Danese 2eb07788e1 fix build 2016-10-26 11:23:19 -07:00
Kubernetes Submit Queue 3ef2158a2e Merge pull request #34892 from dagnello/vsphere-session
Automatic merge from submit-queue

vSphere cloud provider: re-use session for vCenter logins

This change allows for the re-use of a vCenter client session.  Addresses #34491
2016-10-26 11:09:27 -07:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Davide Agnello 4805e6e6f6 vSphere cloud provider: re-use session for vCenter logins
Resolves #34491
2016-10-19 16:54:30 -07:00
Ritesh H Shukla 26db528da3 Fix panic in vSphere when deploying on a single ESX node.
Use ComputeResource instead of ClusterComputeResource when
initializing the vSphere Cloud Provider
2016-10-17 23:42:59 +00:00
Justin Santa Barbara 54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
Davide Agnello fda70d220b ExternalID/InstanceID not returning appropriate error for missing VM
Addresses #33215.
When vCenter returns error vm not found, this is now being translated to
the appropriate error 'cloudprovider.InstanceNotFound' which indicates
to Kubernetes node controller that the VM is in fact not found.
2016-09-23 08:54:35 -07:00
Abrar Shivani 57180093af Support for storage class for vSphere volume plugin. Custom disk format for dynamic provisioning. 2016-09-16 17:15:38 -07:00
Kubernetes Submit Queue 8a56b6b27c Merge pull request #32265 from lojies/errmodify
Automatic merge from submit-queue

modify error return

err is nil here,chage it to fmt.Errorf("cannot find SCSI controller in VM")
2016-09-13 01:16:03 -07:00
Kubernetes Submit Queue ff1cec99cc Merge pull request #32307 from mikedanese/cloud-owners
Automatic merge from submit-queue

update pkg/cloudprovider OWNERS to spread the review load

This is going to make the mungebot start assigning reviews in your cloudprovider packages.

fyi @runseb @dagnello @imkin @anguslees @dagnello
2016-09-12 00:08:23 -07:00
Kubernetes Submit Queue 5b23de5b38 Merge pull request #30836 from abrarshivani/vsphere_dynamic_proviosioning
Automatic merge from submit-queue

Fix: Dynamic provisioning for vSphere

This PR does the following,

1. Fixes an error 'A specified parameter was not correct:' occurs while dynamically provisioning the volumes.
2. Adds VSAN support for dynamic provisioning.
2016-09-10 17:21:08 -07:00
Mike Danese 418bfb6453 update pkg/cloudprovider OWNERS to spread the load 2016-09-08 15:13:21 -07:00
lojies d45dfda425 modify error return 2016-09-08 16:36:33 +08:00
Kubernetes Submit Queue 93c9b05bc9 Merge pull request #31979 from dagnello/vsphere-cleanup-controller-nil-check
Automatic merge from submit-queue

vSphere Cloud provider null pointer exception

This PR addresses issue #31823.

SelectByType function in govmomi will panic if deviceType is not Array,
Chan, Map, Ptr, or Slice.  Also checking if vmDevices or vm are nil,
there is nothing to cleanup.
2016-09-07 23:30:48 -07:00
Kubernetes Submit Queue 2977d03bfe Merge pull request #30935 from vipulsabhaya/vsphere_zones
Automatic merge from submit-queue

Make a vSphere cluster the failure_zone

vSphere cloud provider returns the FailureZone as Cluster, if the VM belongs to a ResourcePool under a Cluster. 

fixes: #30933

* Currently the vSphere cloud provider treats Datacenter as the failure
  Zone.  This doesn't necessarily work since in the current implemention
  Kubernetes nodes cannot span Datacenters.
* This change introduces Clusters as the failure zone, while treating
  Datacenters as Regions
* Also updated tests for Zones
2016-09-05 18:57:45 -07:00
Davide Agnello 87e721367e vSphere Cloud provider null pointer exception
SelectByType function in govmomi will panic if deviceType is not Array,
Chan, Map, Ptr, or Slice.  Also checking if vmDevices or vm are nil,
there is nothing to cleanup.
2016-09-02 07:50:19 -07:00
Jedrzej Nowak 9e2abd4b02 Fix various typos in pgk/cloudprovider,dns,kubectl 2016-08-31 18:56:52 +02:00
Vipul Sabhaya 808f18439d Make a vSphere cluster the failure_zone
* Currently the vSphere cloud provider treats Datacenter as the failure
  Zone.  This doesn't necessarily work since in the current implemention
  Kubernetes nodes cannot span Datacenters.
* This change introduces Clusters as the failure zone, while treating
  Datacenters as Regions
* Also updated tests for Zones
2016-08-25 15:37:24 -07:00
Abrar Shivani 551cea9600 Fix: dynamic provisioning for vSphere 2016-08-23 15:48:47 -07:00
Abrar Shivani e89ad04422 Implements Attacher Plugin Interface for vSphere 2016-08-19 00:28:55 -07:00
Kubernetes Submit Queue 2537f66f0e Merge pull request #29230 from luxas/goimport
Automatic merge from submit-queue

Run goimport for the whole repo

While removing GOMAXPROC and running goimports, I noticed quite a lot of other files also needed a goimport format. Didn't commit `*.generated.go`, `*.deepcopy.go` or files in `vendor`

This is more for testing if it builds.
The only strange thing here is the gopkg.in/gcfg.v1 => github.com/scalingdata/gcfg replace.
cc @jfrazelle @thockin
2016-08-05 16:22:01 -07:00
Abrar Shivani 87e7535e94 - Updated vmware/govmomi godep (Needs for vsan support)
- Fix unmount for vsanDatastore
- Add support for vsan datastore
2016-08-03 16:37:56 -07:00
Davide Agnello 19642aa4bd vSphere Volume Attach limit bug
- Cannot attach scsi devices to slot #7
- Limit of 4 scsi controllers per vm MAX
2016-08-02 14:49:09 -07:00
Lucas Käldström c88a07ce1a Run goimports 2016-08-02 15:12:39 +03:00