Repository: kubermatic/machine-controller
Pull request #1373 (2022-07-24 16:27:51)

[release/v1.43] Fix logic for finding node by ProviderID
**What this PR does / why we need it**:

This is a manual cherry-pick of #1351 to the `release/v1.43` branch, which is used on the KubeOne 1.4 release branch.

**Optional Release Note**:
```release-note
Fix finding nodes by providerID for clusters with CCM or in-tree cloud provider
```

/assign @moadqassem @ahmedwaleedmalik 

kubermatic-bot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubermatic/machine-controller/pull/1373#" title="Author self-approved">xmudrii</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **moadqassem** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @moadqassem` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubermatic%2Fmachine-controller).

<details open>
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubermatic/machine-controller/blob/release/v1.43/OWNERS)~~ [xmudrii]
- **[pkg/cloudprovider/provider/OWNERS](https://github.com/kubermatic/machine-controller/blob/release/v1.43/pkg/cloudprovider/provider/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["moadqassem"]} -->
kubermatic-bot: @xmudrii: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-nutanix | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-nutanix/1551242799905509376) | false | `/test pull-machine-controller-e2e-nutanix`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1373)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kubermatic-bot: @xmudrii: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-nutanix | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-nutanix/1551242799905509376) | false | `/test pull-machine-controller-e2e-nutanix`
pull-machine-controller-e2e-equinix-metal | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-equinix-metal/1551242798219399168) | false | `/test pull-machine-controller-e2e-equinix-metal`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1373)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kubermatic-bot: @xmudrii: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-nutanix | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-nutanix/1551242799905509376) | false | `/test pull-machine-controller-e2e-nutanix`
pull-machine-controller-e2e-equinix-metal | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-equinix-metal/1551242798219399168) | false | `/test pull-machine-controller-e2e-equinix-metal`
pull-machine-controller-e2e-vsphere | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-vsphere/1551242799058259968) | true | `/test pull-machine-controller-e2e-vsphere`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1373)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kubermatic-bot: @xmudrii: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-nutanix | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-nutanix/1551242799905509376) | false | `/test pull-machine-controller-e2e-nutanix`
pull-machine-controller-e2e-equinix-metal | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-equinix-metal/1551242798219399168) | false | `/test pull-machine-controller-e2e-equinix-metal`
pull-machine-controller-e2e-vsphere | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-vsphere/1551242799058259968) | true | `/test pull-machine-controller-e2e-vsphere`
pull-machine-controller-e2e-kubevirt | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-kubevirt/1551242790233444352) | true | `/test pull-machine-controller-e2e-kubevirt`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1373)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kubermatic-bot: @xmudrii: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-nutanix | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-nutanix/1551242799905509376) | false | `/test pull-machine-controller-e2e-nutanix`
pull-machine-controller-e2e-equinix-metal | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-equinix-metal/1551242798219399168) | false | `/test pull-machine-controller-e2e-equinix-metal`
pull-machine-controller-e2e-vsphere | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-vsphere/1551242799058259968) | true | `/test pull-machine-controller-e2e-vsphere`
pull-machine-controller-e2e-kubevirt | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-kubevirt/1551242790233444352) | true | `/test pull-machine-controller-e2e-kubevirt`
pull-machine-controller-e2e-aws-flatcar-containerd | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-aws-flatcar-containerd/1551242803248369664) | true | `/test pull-machine-controller-e2e-aws-flatcar-containerd`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1373)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
xmudrii: /test pull-machine-controller-e2e-aws-flatcar-containerd
kubermatic-bot: @xmudrii: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-nutanix | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-nutanix/1551242799905509376) | false | `/test pull-machine-controller-e2e-nutanix`
pull-machine-controller-e2e-equinix-metal | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-equinix-metal/1551242798219399168) | false | `/test pull-machine-controller-e2e-equinix-metal`
pull-machine-controller-e2e-vsphere | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-vsphere/1551242799058259968) | true | `/test pull-machine-controller-e2e-vsphere`
pull-machine-controller-e2e-kubevirt | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-kubevirt/1551242790233444352) | true | `/test pull-machine-controller-e2e-kubevirt`
pull-machine-controller-e2e-aws-flatcar-containerd | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-aws-flatcar-containerd/1551292423118786560) | true | `/test pull-machine-controller-e2e-aws-flatcar-containerd`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1373)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kubermatic-bot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubermatic/machine-controller/pull/1373#" title="Author self-approved">xmudrii</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please ask for approval from **ahmedwaleedmalik** after the PR has been reviewed.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubermatic%2Fmachine-controller).

<details open>
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubermatic/machine-controller/blob/release/v1.43/OWNERS)~~ [xmudrii]
- **[pkg/cloudprovider/provider/OWNERS](https://github.com/kubermatic/machine-controller/blob/release/v1.43/pkg/cloudprovider/provider/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["ahmedwaleedmalik"]} -->
kubermatic-bot: @xmudrii: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-nutanix | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-nutanix/1551242799905509376) | false | `/test pull-machine-controller-e2e-nutanix`
pull-machine-controller-e2e-vsphere | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-vsphere/1551242799058259968) | true | `/test pull-machine-controller-e2e-vsphere`
pull-machine-controller-e2e-kubevirt | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-kubevirt/1551242790233444352) | true | `/test pull-machine-controller-e2e-kubevirt`
pull-machine-controller-e2e-aws-flatcar-containerd | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-aws-flatcar-containerd/1551292423118786560) | true | `/test pull-machine-controller-e2e-aws-flatcar-containerd`
pull-machine-controller-e2e-equinix-metal | ae701778773bacca11814cb38722be3c53c36b48 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-equinix-metal/1551468546779779072) | false | `/test pull-machine-controller-e2e-equinix-metal`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1373)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kubermatic-bot: @xmudrii: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-nutanix | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-nutanix/1551242799905509376) | false | `/test pull-machine-controller-e2e-nutanix`
pull-machine-controller-e2e-vsphere | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-vsphere/1551242799058259968) | true | `/test pull-machine-controller-e2e-vsphere`
pull-machine-controller-e2e-kubevirt | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-kubevirt/1551242790233444352) | true | `/test pull-machine-controller-e2e-kubevirt`
pull-machine-controller-e2e-equinix-metal | ae701778773bacca11814cb38722be3c53c36b48 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-equinix-metal/1551468546779779072) | false | `/test pull-machine-controller-e2e-equinix-metal`
pull-machine-controller-e2e-azure | ae701778773bacca11814cb38722be3c53c36b48 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-azure/1551468543415947264) | true | `/test pull-machine-controller-e2e-azure`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1373)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
kubermatic-bot: @xmudrii: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-machine-controller-e2e-nutanix | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-nutanix/1551242799905509376) | false | `/test pull-machine-controller-e2e-nutanix`
pull-machine-controller-e2e-vsphere | 6c4bbe4448a8bb2bf0086ef5e05ec088792cc17b | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-vsphere/1551242799058259968) | true | `/test pull-machine-controller-e2e-vsphere`
pull-machine-controller-e2e-equinix-metal | ae701778773bacca11814cb38722be3c53c36b48 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-equinix-metal/1551468546779779072) | false | `/test pull-machine-controller-e2e-equinix-metal`
pull-machine-controller-e2e-azure | ae701778773bacca11814cb38722be3c53c36b48 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-azure/1551468543415947264) | true | `/test pull-machine-controller-e2e-azure`
pull-machine-controller-e2e-kubevirt | ae701778773bacca11814cb38722be3c53c36b48 | [link](https://public-prow.loodse.com/view/gs/prow-dev-public-data/pr-logs/pull/kubermatic_machine-controller/1373/pull-machine-controller-e2e-kubevirt/1551468538688966656) | true | `/test pull-machine-controller-e2e-kubevirt`

[Full PR test history](https://public-prow.loodse.com/pr-history?org=kubermatic&repo=machine-controller&pr=1373)

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
xmudrii: /test pull-machine-controller-e2e-vsphere
xmudrii: /test pull-machine-controller-e2e-vsphere
xmudrii: /test pull-machine-controller-e2e-vsphere
xmudrii: /test pull-machine-controller-e2e-vsphere
kubermatic-bot: LGTM label has been added.  <details>Git tree hash: 2444eafdbfdc0fe3e770b5076e0198401ef09303</details>
kubermatic-bot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubermatic/machine-controller/pull/1373#pullrequestreview-1049697813" title="LGTM">moadqassem</a>*, *<a href="https://github.com/kubermatic/machine-controller/pull/1373#" title="Author self-approved">xmudrii</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubermatic%2Fmachine-controller).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubermatic/machine-controller/blob/release/v1.43/OWNERS)~~ [moadqassem,xmudrii]
- ~~[pkg/cloudprovider/provider/OWNERS](https://github.com/kubermatic/machine-controller/blob/release/v1.43/pkg/cloudprovider/provider/OWNERS)~~ [moadqassem]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/.prow.yaml b/.prow.yaml
index 5c5c58db..31a4a3f4 100644
--- a/.prow.yaml
+++ b/.prow.yaml
@@ -159,7 +159,7 @@ presubmits:
       preset-e2e-ssh: "true"
       preset-hetzner: "true"
       preset-openstack: "true"
-      preset-vsphere: "true"
+      preset-vsphere-legacy: "true"
       preset-kubevirt: "true"
       preset-alibaba: "true"
       preset-goproxy: "true"
@@ -550,7 +550,7 @@ presubmits:
     labels:
       preset-hetzner: "true"
       preset-e2e-ssh: "true"
-      preset-vsphere: "true"
+      preset-vsphere-legacy: "true"
       preset-rhel: "true"
       preset-goproxy: "true"
     spec:
@@ -568,7 +568,8 @@ presubmits:
   - name: pull-machine-controller-e2e-nutanix
     optional: true
     always_run: false
-    run_if_changed: "(pkg/cloudprovider/provider/nutanix/|pkg/userdata/|test/e2e/provisioning/)"
+    # TODO uncomment this when Nutanix is in a working condition
+    # run_if_changed: "(pkg/cloudprovider/provider/nutanix/|pkg/userdata/|test/e2e/provisioning/)"
     decorate: true
     error_on_eviction: true
     clone_uri: "ssh://git@github.com/kubermatic/machine-controller.git"
@@ -794,7 +795,7 @@ presubmits:
     error_on_eviction: true
     clone_uri: "ssh://git@github.com/kubermatic/machine-controller.git"
     labels:
-      preset-vsphere: "true"
+      preset-vsphere-legacy: "true"
       preset-rhel: "true"
       preset-hetzner: "true"
       preset-e2e-ssh: "true"
@@ -817,7 +818,7 @@ presubmits:
     error_on_eviction: true
     clone_uri: "ssh://git@github.com/kubermatic/machine-controller.git"
     labels:
-      preset-vsphere: "true"
+      preset-vsphere-legacy: "true"
       preset-rhel: "true"
       preset-hetzner: "true"
       preset-e2e-ssh: "true"
diff --git a/pkg/cloudprovider/instance/instance.go b/pkg/cloudprovider/instance/instance.go
index edadc991..2c44735a 100644
--- a/pkg/cloudprovider/instance/instance.go
+++ b/pkg/cloudprovider/instance/instance.go
@@ -24,6 +24,8 @@ type Instance interface {
 	Name() string
 	// ID returns the instance identifier.
 	ID() string
+	// ProviderID returns the expected providerID for the instance
+	ProviderID() string
 	// Addresses returns a list of addresses associated with the instance.
 	Addresses() map[string]v1.NodeAddressType
 	// Status returns the instance status.
diff --git a/pkg/cloudprovider/provider/alibaba/provider.go b/pkg/cloudprovider/provider/alibaba/provider.go
index 298a0e84..a00be2e8 100644
--- a/pkg/cloudprovider/provider/alibaba/provider.go
+++ b/pkg/cloudprovider/provider/alibaba/provider.go
@@ -86,6 +86,11 @@ func (a *alibabaInstance) ID() string {
 	return a.instance.InstanceId
 }
 
+// TODO: Implement once we start supporting Alibaba CCM.
+func (a *alibabaInstance) ProviderID() string {
+	return ""
+}
+
 func (a *alibabaInstance) Addresses() map[string]v1.NodeAddressType {
 	primaryIPAddresses := map[string]v1.NodeAddressType{}
 	for _, networkInterface := range a.instance.NetworkInterfaces.NetworkInterface {
diff --git a/pkg/cloudprovider/provider/anexia/instance.go b/pkg/cloudprovider/provider/anexia/instance.go
index 7aae264b..4daaadac 100644
--- a/pkg/cloudprovider/provider/anexia/instance.go
+++ b/pkg/cloudprovider/provider/anexia/instance.go
@@ -45,6 +45,11 @@ func (ai *anexiaInstance) ID() string {
 	return ai.info.Identifier
 }
 
+// TODO(xmudrii): Implement this.
+func (ai *anexiaInstance) ProviderID() string {
+	return ""
+}
+
 func (ai *anexiaInstance) Addresses() map[string]v1.NodeAddressType {
 	addresses := map[string]v1.NodeAddressType{}
 
diff --git a/pkg/cloudprovider/provider/aws/provider.go b/pkg/cloudprovider/provider/aws/provider.go
index 1381be5f..4c0524a0 100644
--- a/pkg/cloudprovider/provider/aws/provider.go
+++ b/pkg/cloudprovider/provider/aws/provider.go
@@ -987,6 +987,17 @@ func (d *awsInstance) ID() string {
 	return aws.StringValue(d.instance.InstanceId)
 }
 
+func (d *awsInstance) ProviderID() string {
+	if d.instance.InstanceId == nil {
+		return ""
+	}
+	if d.instance.Placement.AvailabilityZone == nil {
+		return "aws:///" + *d.instance.InstanceId
+	}
+
+	return "aws:///" + *d.instance.Placement.AvailabilityZone + "/" + *d.instance.InstanceId
+}
+
 func (d *awsInstance) Addresses() map[string]v1.NodeAddressType {
 	addresses := map[string]v1.NodeAddressType{
 		aws.StringValue(d.instance.PublicIpAddress):  v1.NodeExternalIP,
diff --git a/pkg/cloudprovider/provider/azure/provider.go b/pkg/cloudprovider/provider/azure/provider.go
index f4200956..3c6c0cc2 100644
--- a/pkg/cloudprovider/provider/azure/provider.go
+++ b/pkg/cloudprovider/provider/azure/provider.go
@@ -122,6 +122,14 @@ func (vm *azureVM) Name() string {
 	return *vm.vm.Name
 }
 
+func (vm *azureVM) ProviderID() string {
+	if vm.vm.ID == nil {
+		return ""
+	}
+
+	return "azure://" + *vm.vm.ID
+}
+
 func (vm *azureVM) Status() instance.Status {
 	return vm.status
 }
diff --git a/pkg/cloudprovider/provider/baremetal/provider.go b/pkg/cloudprovider/provider/baremetal/provider.go
index d65a7f3b..e30be3b2 100644
--- a/pkg/cloudprovider/provider/baremetal/provider.go
+++ b/pkg/cloudprovider/provider/baremetal/provider.go
@@ -53,6 +53,11 @@ func (b bareMetalServer) ID() string {
 	return b.server.GetID()
 }
 
+// TODO: Tinkerbell doesn't have a CCM.
+func (b bareMetalServer) ProviderID() string {
+	return ""
+}
+
 func (b bareMetalServer) Addresses() map[string]corev1.NodeAddressType {
 	return map[string]corev1.NodeAddressType{
 		b.server.GetIPAddress(): corev1.NodeInternalIP,
diff --git a/pkg/cloudprovider/provider/digitalocean/provider.go b/pkg/cloudprovider/provider/digitalocean/provider.go
index 81e99d99..132b39cb 100644
--- a/pkg/cloudprovider/provider/digitalocean/provider.go
+++ b/pkg/cloudprovider/provider/digitalocean/provider.go
@@ -497,6 +497,10 @@ func (d *doInstance) ID() string {
 	return strconv.Itoa(d.droplet.ID)
 }
 
+func (d *doInstance) ProviderID() string {
+	return fmt.Sprintf("digitalocean://%d", d.droplet.ID)
+}
+
 func (d *doInstance) Addresses() map[string]v1.NodeAddressType {
 	addresses := map[string]v1.NodeAddressType{}
 	for _, n := range d.droplet.Networks.V4 {
diff --git a/pkg/cloudprovider/provider/equinixmetal/provider.go b/pkg/cloudprovider/provider/equinixmetal/provider.go
index d045435b..1ca16fb8 100644
--- a/pkg/cloudprovider/provider/equinixmetal/provider.go
+++ b/pkg/cloudprovider/provider/equinixmetal/provider.go
@@ -372,6 +372,10 @@ func (s *metalDevice) ID() string {
 	return s.device.ID
 }
 
+func (s *metalDevice) ProviderID() string {
+	return "equinixmetal://" + s.device.ID
+}
+
 func (s *metalDevice) Addresses() map[string]v1.NodeAddressType {
 	// returns addresses in CIDR format
 	addresses := map[string]v1.NodeAddressType{}
diff --git a/pkg/cloudprovider/provider/fake/provider.go b/pkg/cloudprovider/provider/fake/provider.go
index ea612658..da93506f 100644
--- a/pkg/cloudprovider/provider/fake/provider.go
+++ b/pkg/cloudprovider/provider/fake/provider.go
@@ -47,6 +47,10 @@ func (f CloudProviderInstance) ID() string {
 	return ""
 }
 
+func (f CloudProviderInstance) ProviderID() string {
+	return ""
+}
+
 func (f CloudProviderInstance) Addresses() map[string]v1.NodeAddressType {
 	return nil
 }
diff --git a/pkg/cloudprovider/provider/gce/instance.go b/pkg/cloudprovider/provider/gce/instance.go
index 3426e219..43f3545f 100644
--- a/pkg/cloudprovider/provider/gce/instance.go
+++ b/pkg/cloudprovider/provider/gce/instance.go
@@ -60,6 +60,10 @@ func (gi *googleInstance) ID() string {
 	return strconv.FormatUint(gi.ci.Id, 10)
 }
 
+func (gi *googleInstance) ProviderID() string {
+	return fmt.Sprintf("gce://%s/%s/%s", gi.projectID, gi.zone, gi.ci.Name)
+}
+
 // Addresses implements instance.Instance.
 func (gi *googleInstance) Addresses() map[string]v1.NodeAddressType {
 	addrs := map[string]v1.NodeAddressType{}
diff --git a/pkg/cloudprovider/provider/hetzner/provider.go b/pkg/cloudprovider/provider/hetzner/provider.go
index 5dd548b0..9fc7a382 100644
--- a/pkg/cloudprovider/provider/hetzner/provider.go
+++ b/pkg/cloudprovider/provider/hetzner/provider.go
@@ -538,6 +538,10 @@ func (s *hetznerServer) ID() string {
 	return strconv.Itoa(s.server.ID)
 }
 
+func (s *hetznerServer) ProviderID() string {
+	return fmt.Sprintf("hcloud://%d", s.server.ID)
+}
+
 func (s *hetznerServer) Addresses() map[string]v1.NodeAddressType {
 	addresses := map[string]v1.NodeAddressType{}
 	for _, fips := range s.server.PublicNet.FloatingIPs {
diff --git a/pkg/cloudprovider/provider/kubevirt/provider.go b/pkg/cloudprovider/provider/kubevirt/provider.go
index 67e78105..70b87197 100644
--- a/pkg/cloudprovider/provider/kubevirt/provider.go
+++ b/pkg/cloudprovider/provider/kubevirt/provider.go
@@ -98,6 +98,10 @@ func (k *kubeVirtServer) ID() string {
 	return string(k.vmi.UID)
 }
 
+func (k *kubeVirtServer) ProviderID() string {
+	return "kubevirt://" + k.vmi.Name
+}
+
 func (k *kubeVirtServer) Addresses() map[string]corev1.NodeAddressType {
 	addresses := map[string]corev1.NodeAddressType{}
 	for _, kvInterface := range k.vmi.Status.Interfaces {
diff --git a/pkg/cloudprovider/provider/linode/provider.go b/pkg/cloudprovider/provider/linode/provider.go
index dbcd01c0..7adaf4e6 100644
--- a/pkg/cloudprovider/provider/linode/provider.go
+++ b/pkg/cloudprovider/provider/linode/provider.go
@@ -411,6 +411,11 @@ func (d *linodeInstance) ID() string {
 	return strconv.Itoa(d.linode.ID)
 }
 
+// TODO: Implement once we start supporting Linode CCM.
+func (d *linodeInstance) ProviderID() string {
+	return ""
+}
+
 func (d *linodeInstance) Addresses() map[string]v1.NodeAddressType {
 	addresses := map[string]v1.NodeAddressType{}
 	for _, n := range d.linode.IPv4 {
diff --git a/pkg/cloudprovider/provider/nutanix/provider.go b/pkg/cloudprovider/provider/nutanix/provider.go
index 5884d776..7b29a361 100644
--- a/pkg/cloudprovider/provider/nutanix/provider.go
+++ b/pkg/cloudprovider/provider/nutanix/provider.go
@@ -85,6 +85,11 @@ func (nutanixServer Server) ID() string {
 	return nutanixServer.id
 }
 
+// NB: Nutanix doesn't have a CCM.
+func (nutanixServer Server) ProviderID() string {
+	return ""
+}
+
 func (nutanixServer Server) Addresses() map[string]corev1.NodeAddressType {
 	return nutanixServer.addresses
 }
diff --git a/pkg/cloudprovider/provider/openstack/provider.go b/pkg/cloudprovider/provider/openstack/provider.go
index 0940b6d9..b335f3cf 100644
--- a/pkg/cloudprovider/provider/openstack/provider.go
+++ b/pkg/cloudprovider/provider/openstack/provider.go
@@ -931,6 +931,10 @@ func (d *osInstance) ID() string {
 	return d.server.ID
 }
 
+func (d *osInstance) ProviderID() string {
+	return "openstack:///" + d.server.ID
+}
+
 func (d *osInstance) Addresses() map[string]corev1.NodeAddressType {
 	addresses := map[string]corev1.NodeAddressType{}
 	for _, networkAddresses := range d.server.Addresses {
diff --git a/pkg/cloudprovider/provider/scaleway/provider.go b/pkg/cloudprovider/provider/scaleway/provider.go
index 1f173829..c05dbede 100644
--- a/pkg/cloudprovider/provider/scaleway/provider.go
+++ b/pkg/cloudprovider/provider/scaleway/provider.go
@@ -382,6 +382,11 @@ func (s *scwServer) ID() string {
 	return s.server.ID
 }
 
+// TODO: Implement once we start supporting Scaleway CCM.
+func (s *scwServer) ProviderID() string {
+	return ""
+}
+
 func (s *scwServer) Addresses() map[string]v1.NodeAddressType {
 	addresses := map[string]v1.NodeAddressType{}
 	if s.server.PrivateIP != nil {
diff --git a/pkg/cloudprovider/provider/vsphere/provider.go b/pkg/cloudprovider/provider/vsphere/provider.go
index 0c33a80c..de267fc9 100644
--- a/pkg/cloudprovider/provider/vsphere/provider.go
+++ b/pkg/cloudprovider/provider/vsphere/provider.go
@@ -82,6 +82,7 @@ var _ instance.Instance = &Server{}
 type Server struct {
 	name      string
 	id        string
+	uuid      string
 	status    instance.Status
 	addresses map[string]corev1.NodeAddressType
 }
@@ -94,6 +95,10 @@ func (vsphereServer Server) ID() string {
 	return vsphereServer.id
 }
 
+func (vsphereServer Server) ProviderID() string {
+	return "vsphere://" + vsphereServer.uuid
+}
+
 func (vsphereServer Server) Addresses() map[string]corev1.NodeAddressType {
 	return vsphereServer.addresses
 }
@@ -351,7 +356,7 @@ func (p *provider) create(machine *v1alpha1.Machine, userdata string) (instance.
 		return nil, fmt.Errorf("error when waiting for vm powerOn task: %v", err)
 	}
 
-	return Server{name: virtualMachine.Name(), status: instance.StatusRunning, id: virtualMachine.Reference().Value}, nil
+	return Server{name: virtualMachine.Name(), status: instance.StatusRunning, id: virtualMachine.Reference().Value, uuid: virtualMachine.UUID(ctx)}, nil
 }
 
 func (p *provider) Cleanup(machine *v1alpha1.Machine, data *cloudprovidertypes.ProviderData) (bool, error) {
@@ -482,7 +487,7 @@ func (p *provider) Get(machine *v1alpha1.Machine, data *cloudprovidertypes.Provi
 		}
 		// We must return here because the vendored code for determining if the guest
 		// utils are running yields an NPD when using with an instance that is not running
-		return Server{name: virtualMachine.Name(), status: instance.StatusUnknown}, nil
+		return Server{name: virtualMachine.Name(), status: instance.StatusUnknown, uuid: virtualMachine.UUID(ctx)}, nil
 	}
 
 	// virtualMachine.IsToolsRunning panics when executed on a VM that is not powered on
@@ -510,7 +515,7 @@ func (p *provider) Get(machine *v1alpha1.Machine, data *cloudprovidertypes.Provi
 		klog.V(3).Infof("Can't fetch the IP addresses for machine %s, the VMware guest utils are not running yet. This might take a few minutes", machine.Spec.Name)
 	}
 
-	return Server{name: virtualMachine.Name(), status: instance.StatusRunning, addresses: addresses, id: virtualMachine.Reference().Value}, nil
+	return Server{name: virtualMachine.Name(), status: instance.StatusRunning, addresses: addresses, id: virtualMachine.Reference().Value, uuid: virtualMachine.UUID(ctx)}, nil
 }
 
 func (p *provider) MigrateUID(machine *v1alpha1.Machine, new ktypes.UID) error {
diff --git a/pkg/controller/machine/machine_controller.go b/pkg/controller/machine/machine_controller.go
index d7977bf4..6bf2f089 100644
--- a/pkg/controller/machine/machine_controller.go
+++ b/pkg/controller/machine/machine_controller.go
@@ -880,6 +880,23 @@ func (r *Reconciler) ensureInstanceExistsForMachine(
 	addresses := providerInstance.Addresses()
 	eventMessage := fmt.Sprintf("Found instance at cloud provider, addresses: %v", addresses)
 	r.recorder.Event(machine, corev1.EventTypeNormal, "InstanceFound", eventMessage)
+	// It might happen that we got here, but we still don't have IP addresses
+	// for the instance. In that case it doesn't make sense to proceed because:
+	//   * if we match Node by ProviderID, Machine will get NodeOwnerRef, but
+	//     there will be no IP address on that Machine object. Since we
+	//     successfully set NodeOwnerRef, Machine will not be reconciled again,
+	//     so it will never get IP addresses. This breaks the NodeCSRApprover
+	//     workflow because NodeCSRApprover cannot validate certificates without
+	//     IP addresses, resulting in a broken Node
+	//   * if we can't match Node by ProviderID, fallback to matching by IP
+	//     address will not have any result because we still don't have IP
+	//     addresses for that instance
+	// Considering that, we just retry after 15 seconds, hoping that we'll
+	// get IP addresses by then.
+	if len(addresses) == 0 {
+		return &reconcile.Result{RequeueAfter: 15 * time.Second}, nil
+	}
+
 	machineAddresses := []corev1.NodeAddress{}
 	for address, addressType := range addresses {
 		machineAddresses = append(machineAddresses, corev1.NodeAddress{Address: address, Type: addressType})
@@ -1042,19 +1059,13 @@ func (r *Reconciler) getNode(ctx context.Context, instance instance.Instance, pr
 		return nil, false, err
 	}
 
-	// We trim leading slashes in raw ID, since we always want three slashes in full ID
-	providerID := fmt.Sprintf("%s:///%s", provider, strings.TrimLeft(instance.ID(), "/"))
 	for _, node := range nodes.Items {
-		if provider == providerconfigtypes.CloudProviderAzure {
-			// Azure IDs are case-insensitive
-			if strings.EqualFold(node.Spec.ProviderID, providerID) {
-				return node.DeepCopy(), true, nil
-			}
-		} else {
-			if node.Spec.ProviderID == providerID {
-				return node.DeepCopy(), true, nil
-			}
+		// Try to find Node by providerID. Should work if CCM is deployed.
+		if node := findNodeByProviderID(instance, provider, nodes.Items); node != nil {
+			klog.V(4).Infof("Found node %q by providerID", node.Name)
+			return node, true, nil
 		}
+
 		// If we were unable to find Node by ProviderID, fallback to IP address matching.
 		// This usually happens if there's no CCM deployed in the cluster.
 		//
@@ -1081,6 +1092,7 @@ func (r *Reconciler) getNode(ctx context.Context, instance instance.Instance, pr
 					continue
 				}
 				if nodeAddress.Address == instanceAddress {
+					klog.V(4).Infof("Found node %q by IP address", node.Name)
 					return node.DeepCopy(), true, nil
 				}
 			}
@@ -1089,6 +1101,32 @@ func (r *Reconciler) getNode(ctx context.Context, instance instance.Instance, pr
 	return nil, false, nil
 }
 
+func findNodeByProviderID(instance instance.Instance, provider providerconfigtypes.CloudProvider, nodes []corev1.Node) *corev1.Node {
+	providerID := instance.ProviderID()
+	if providerID == "" {
+		return nil
+	}
+
+	for _, node := range nodes {
+		if strings.EqualFold(node.Spec.ProviderID, providerID) {
+			return node.DeepCopy()
+		}
+
+		// AWS has two different providerID notations:
+		//   * aws:///<availability-zone>/<instance-id>
+		//   * aws:///<instance-id>
+		// The first case is handled above, while the second here is handled here.
+		if provider == providerconfigtypes.CloudProviderAWS {
+			pid := strings.Split(node.Spec.ProviderID, "aws:///")
+			if len(pid) == 2 && pid[1] == instance.ID() {
+				return node.DeepCopy()
+			}
+		}
+	}
+
+	return nil
+}
+
 func (r *Reconciler) ReadinessChecks(ctx context.Context) map[string]healthcheck.Check {
 	return map[string]healthcheck.Check{
 		"valid-info-kubeconfig": func() error {


Test patch:
diff --git a/pkg/controller/machine/machine_test.go b/pkg/controller/machine/machine_test.go
index a9322ca3..c0d9a27d 100644
--- a/pkg/controller/machine/machine_test.go
+++ b/pkg/controller/machine/machine_test.go
@@ -48,10 +48,11 @@ func init() {
 }
 
 type fakeInstance struct {
-	name      string
-	id        string
-	addresses map[string]corev1.NodeAddressType
-	status    instance.Status
+	name       string
+	id         string
+	providerID string
+	addresses  map[string]corev1.NodeAddressType
+	status     instance.Status
 }
 
 func (i *fakeInstance) Name() string {
@@ -62,6 +63,10 @@ func (i *fakeInstance) ID() string {
 	return i.id
 }
 
+func (i *fakeInstance) ProviderID() string {
+	return i.providerID
+}
+
 func (i *fakeInstance) Status() instance.Status {
 	return i.status
 }
@@ -70,11 +75,7 @@ func (i *fakeInstance) Addresses() map[string]corev1.NodeAddressType {
 	return i.addresses
 }
 
-func getTestNode(id, provider string) corev1.Node {
-	providerID := ""
-	if provider != "" {
-		providerID = fmt.Sprintf("%s:///%s", provider, id)
-	}
+func getTestNode(id, providerID string) corev1.Node {
 	return corev1.Node{
 		ObjectMeta: metav1.ObjectMeta{
 			Name: fmt.Sprintf("node%s", id),
@@ -98,10 +99,10 @@ func getTestNode(id, provider string) corev1.Node {
 }
 
 func TestController_GetNode(t *testing.T) {
-	node1 := getTestNode("1", "aws")
-	node2 := getTestNode("2", "openstack")
+	node1 := getTestNode("1", "aws:///i-1")
+	node2 := getTestNode("2", "openstack:///test")
 	node3 := getTestNode("3", "")
-	node4 := getTestNode("4", "hetzner")
+	node4 := getTestNode("4", "hcloud://123")
 	nodeList := []*corev1.Node{&node1, &node2, &node3, &node4}
 
 	tests := []struct {
@@ -134,7 +135,7 @@ func TestController_GetNode(t *testing.T) {
 			resNode:  &node1,
 			exists:   true,
 			err:      nil,
-			instance: &fakeInstance{id: "1", addresses: map[string]corev1.NodeAddressType{"": ""}},
+			instance: &fakeInstance{id: "1", addresses: map[string]corev1.NodeAddressType{"": ""}, providerID: "aws:///i-1"},
 		},
 		{
 			name:     "node found by internal ip",
@@ -182,7 +183,7 @@ func TestController_GetNode(t *testing.T) {
 			resNode:  &node4,
 			exists:   true,
 			err:      nil,
-			instance: &fakeInstance{id: "4", addresses: map[string]corev1.NodeAddressType{"": ""}},
+			instance: &fakeInstance{id: "4", addresses: map[string]corev1.NodeAddressType{"": ""}, providerID: "hcloud://123"},
 		},
 	}
 
@@ -634,3 +635,53 @@ func TestControllerDeleteNodeForMachine(t *testing.T) {
 		})
 	}
 }
+
+func TestControllerFindNodeByProviderID(t *testing.T) {
+	tests := []struct {
+		name         string
+		instance     instance.Instance
+		provider     providerconfigtypes.CloudProvider
+		nodes        []corev1.Node
+		expectedNode bool
+	}{
+		{
+			name:     "aws providerID type 1",
+			instance: &fakeInstance{id: "99", providerID: "aws:///some-zone/i-99"},
+			provider: providerconfigtypes.CloudProviderAWS,
+			nodes: []corev1.Node{
+				getTestNode("1", "random"),
+				getTestNode("2", "aws:///some-zone/i-99"),
+			},
+			expectedNode: true,
+		},
+		{
+			name:     "aws providerID type 2",
+			instance: &fakeInstance{id: "99", providerID: "aws:///i-99"},
+			provider: providerconfigtypes.CloudProviderAWS,
+			nodes: []corev1.Node{
+				getTestNode("1", "aws:///i-99"),
+				getTestNode("2", "random"),
+			},
+			expectedNode: true,
+		},
+		{
+			name:     "azure providerID",
+			instance: &fakeInstance{id: "99", providerID: "azure:///test/test"},
+			provider: providerconfigtypes.CloudProviderAWS,
+			nodes: []corev1.Node{
+				getTestNode("1", "random"),
+				getTestNode("2", "azure:///test/test"),
+			},
+			expectedNode: true,
+		},
+	}
+
+	for _, test := range tests {
+		t.Run(test.name, func(t *testing.T) {
+			node := findNodeByProviderID(test.instance, test.provider, test.nodes)
+			if (node != nil) != test.expectedNode {
+				t.Errorf("expected %t, but got %t", test.expectedNode, (node != nil))
+			}
+		})
+	}
+}
diff --git a/test/e2e/provisioning/helper.go b/test/e2e/provisioning/helper.go
index 8583dd07..873d4826 100644
--- a/test/e2e/provisioning/helper.go
+++ b/test/e2e/provisioning/helper.go
@@ -205,6 +205,20 @@ func testScenario(t *testing.T, testCase scenario, cloudProvider string, testPar
 		scenarioParams = append(scenarioParams, fmt.Sprintf("<< MAX_PRICE >>=%s", "0.03"))
 	}
 
+	if strings.Contains(cloudProvider, string(providerconfigtypes.CloudProviderEquinixMetal)) {
+		switch testCase.osName {
+		case string(providerconfigtypes.OperatingSystemCentOS):
+			scenarioParams = append(scenarioParams, fmt.Sprintf("<< INSTANCE_TYPE >>=%s", "m3.small.x86"))
+			scenarioParams = append(scenarioParams, fmt.Sprintf("<< FACILITY_CODE >>=%s", "am6"))
+		case string(providerconfigtypes.OperatingSystemFlatcar):
+			scenarioParams = append(scenarioParams, fmt.Sprintf("<< INSTANCE_TYPE >>=%s", "c3.small.x86"))
+			scenarioParams = append(scenarioParams, fmt.Sprintf("<< FACILITY_CODE >>=%s", "ny5"))
+		case string(providerconfigtypes.OperatingSystemUbuntu):
+			scenarioParams = append(scenarioParams, fmt.Sprintf("<< INSTANCE_TYPE >>=%s", "m3.small.x86"))
+			scenarioParams = append(scenarioParams, fmt.Sprintf("<< FACILITY_CODE >>=%s", "am6"))
+		}
+	}
+
 	// only used by assume role scenario, otherwise empty (disabled)
 	scenarioParams = append(scenarioParams, fmt.Sprintf("<< AWS_ASSUME_ROLE_ARN >>=%s", os.Getenv("AWS_ASSUME_ROLE_ARN")))
 	scenarioParams = append(scenarioParams, fmt.Sprintf("<< AWS_ASSUME_ROLE_EXTERNAL_ID >>=%s", os.Getenv("AWS_ASSUME_ROLE_EXTERNAL_ID")))
diff --git a/test/e2e/provisioning/testdata/machinedeployment-equinixmetal.yaml b/test/e2e/provisioning/testdata/machinedeployment-equinixmetal.yaml
index 28e52c4f..b8a74a7d 100644
--- a/test/e2e/provisioning/testdata/machinedeployment-equinixmetal.yaml
+++ b/test/e2e/provisioning/testdata/machinedeployment-equinixmetal.yaml
@@ -26,9 +26,9 @@ spec:
           cloudProviderSpec:
             token: << METAL_AUTH_TOKEN >>
             projectID: << METAL_PROJECT_ID >>
-            instanceType: "c1.small.x86"
+            instanceType: "<< INSTANCE_TYPE >>"
             facilities:
-            - "ams1"
+            - "<< FACILITY_CODE >>"
           operatingSystem: "<< OS_NAME >>"
           operatingSystemSpec:
             distUpgradeOnBoot: false
diff --git a/test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml b/test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
index bd185101..71d4a967 100644
--- a/test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
+++ b/test/e2e/provisioning/testdata/machinedeployment-kubevirt.yaml
@@ -28,7 +28,7 @@ spec:
           cloudProviderSpec:
             storageClassName: longhorn
             pvcSize: "10Gi"
-            sourceURL: http://10.244.1.19/<< OS_NAME >>.img
+            sourceURL: http://image-repo.kube-system.svc.cluster.local/images/<< OS_NAME >>.img
             cpus: "1"
             memory: "4096M"
             dnsPolicy: "None"