pulumiverse-esxi-native


Namepulumiverse-esxi-native JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/pulumiverse/pulumi-esxi-native
SummaryVMWare ESXi provider to provision VMs directly on an ESXi hypervisor without a need for vCenter or vSphere.
upload_time2023-09-21 19:24:03
maintainer
docs_urlNone
author
requires_python>=3.7
licenseApache-2.0
keywords pulumi esxi esxi-native category/infrastructure kind/native
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pulumi Native ESXi Provider

This repository crates a VMWare ESXi provider to provision VMs directly on an ESXi hypervisor without a need for vCenter or vSphere.

[![ci](https://github.com/pulumiverse/pulumi-esxi-native/actions/workflows/ci.yaml/badge.svg)](https://github.com/pulumiverse/pulumi-esxi-native/actions/workflows/ci.yaml) [![release](https://github.com/pulumiverse/pulumi-esxi-native/actions/workflows/release.yml/badge.svg)](https://github.com/pulumiverse/pulumi-esxi-native/actions/workflows/release.yml)

The repository is created based on the Terraform Provider [terraform-provider-esxi](https://github.com/josenk/terraform-provider-esxi/tree/master).
Thanks to the wonderful work done there by [@josenk](https://github.com/josenk), I was able to build this provider for Pulumi users.

## IMPORTANT NOTES!

**Note for Pull Requests (PRs)**: When creating a pull request, please do it onto the **MAIN branch** which is
the consolidated work-in-progress branch. Do not request it onto another branch.

> **PLEASE** Read our [branch guide](branch-guide.md) to know about our branching policy
>
> ### CONTRIBUTING
>
> **IMPORTANT:** The contribution details are stated [here](CONTRIBUTING.md)

## Requirements
-   The VMware [ovftool](https://customerconnect.vmware.com/downloads/get-download?downloadGroup=OVFTOOL443) is required to be installed in the workstation where pulumi will be executed.  
    > **NOTE:** `ovftool` installer for windows doesn't put ovftool.exe in your path. 
      You will need to manually set your path.
-   You MUST enable ssh access on your ESXi hypervisor.
    > Google 'How to enable ssh access on esxi'
      >- In general, you should know how to use terraform, esxi and some networking...
* You will most likely need a DHCP server on your primary network if you are deploying VMs with public OVF/OVA/VMX images.  (Sources that have unconfigured primary interfaces.)
- The source OVF/OVA/VMX images must have open-vm-tools or vmware-tools installed to properly import an IPAddress.  (you need this to run provisioners)

## Features and Compatibility

* Source image can be a clone of a VM or local vmx, ovf, ova file. This provider uses ovftool, so there should be a wide compatibility.
* Supports adding your VM to Resource Pools to partition CPU and memory usage from other VMs on your ESXi host.
* Pulumi will Create, Destroy, Update & Import Resource Pools.
* Pulumi will Create, Destroy, Update & Import Virtual Machines.
* Pulumi will Create, Destroy, Update & Import Virtual Disks.
* Pulumi will Create, Destroy, Update & Import Virtual Switches.
* Pulumi will Create, Destroy, Update & Import Port Groups.

## Why this provider?

If you do not have a vCenter or vSphere, especially if you are running a home lab, these services are expensive, and maybe you cannot have them, but the ESXi is free, so that is the reason behind it!

## How to install

The Pulumi ESXi Native provider is available as a package in all Pulumi languages:

* JavaScript/TypeScript: [`@pulumiverse/esxi-native`](https://www.npmjs.com/package/@pulumiverse/esxi-native)
* Python: [`pulumiverse_esxi_native`](https://pypi.org/project/pulumiverse_esxi_native/)
* Go: [`github.com/pulumiverse/pulumi-esxi-native/sdk/go/esxi`](https://pkg.go.dev/github.com/pulumiverse/pulumi-esxi-native/sdk/go/esxi)
* .NET: [`Pulumiverse.EsxiNative`](https://www.nuget.org/packages/Pulumiverse.EsxiNative)

### Provider Binary

The ESXi Native provider binary is a third party binary. It can be installed using the `pulumi plugin` command.

```bash
pulumi plugin install resource esxi-native <version> --server github://api.github.com/pulumiverse
```

Replace the `<version>` string with your desired version.

## How to use and configure

In order to use the provider, we need to provide SSH credentials to the ESXi Host

### Set configuration using `pulumi config`

Remember to pass `--secret` when setting `password` so that it is properly encrypted:

```bash
$ pulumi config set esxi-native:username <username>
$ pulumi config set esxi-native:password <password> --secret
$ pulumi config set esxi-native:host <host IP or FQDN>
```

### Set configuration using environment variables

For bash users

```bash
$ export ESXI_USERNAME=<YOUR_ESXI_USERNAME>
$ export ESXI_PASSWORD=<YOUR_ESXI_PASSWORD>
$ export ESXI_HOST=<YOUR_ESXI_HOST_IP>
```

For powershell users

```powershell
> $env:ESXI_USERNAME = "<YOUR_ESXI_USERNAME>"
> $env:ESXI_PASSWORD = "<YOUR_ESXI_PASSWORD>"
> $env:ESXI_HOST = "<YOUR_ESXI_HOST>"
```

### Getting started example

```typescript
import * as esxi from "@pulumiverse/esxi-native";


export = async () => {
    const vm = new esxi.VirtualMachine("vm-test", {
        diskStore: "nvme-ssd-datastore",
        networkInterfaces: [
            {
                virtualNetwork: "default"
            }
        ]
    });

    return {
        "id": vm.id,
        "name": vm.name,
        "os": vm.os,
    };
}
```

## Known issues with vmware_esxi

* Using a local source vmx files should not have any networks configured. There is very limited network interface mapping abilities in packer for vmx files.  
  It's best to simply clean out all network information from your vmx file. The plugin will add network configuration to the destination vm guest as required.
* pulumi import cannot import the guest disk type (thick, thin, etc.) if the VM is powered on and cannot import the guest `ipAddress` if it's powered off.
* Only `numVCpus` are supported, `numCores` is not.
* Doesn't support CD-ROM or floppy.
* Doesn't support Shared bus Interfaces, or Shared disks.
* Using an incorrect password could lockout your account using default esxi pam settings.
* Don't set `startupTimeout` or `shutdownTimeout` to 0 (zero). It's valid, however it will be changed to default values.




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pulumiverse/pulumi-esxi-native",
    "name": "pulumiverse-esxi-native",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "pulumi esxi esxi-native category/infrastructure kind/native",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/5d/f0/2d70755242f5e2bdbdbaf6ac0f4512e4b765aba71bf89b8483ec6cbf851a/pulumiverse_esxi_native-1.0.0.tar.gz",
    "platform": null,
    "description": "# Pulumi Native ESXi Provider\n\nThis repository crates a VMWare ESXi provider to provision VMs directly on an ESXi hypervisor without a need for vCenter or vSphere.\n\n[![ci](https://github.com/pulumiverse/pulumi-esxi-native/actions/workflows/ci.yaml/badge.svg)](https://github.com/pulumiverse/pulumi-esxi-native/actions/workflows/ci.yaml) [![release](https://github.com/pulumiverse/pulumi-esxi-native/actions/workflows/release.yml/badge.svg)](https://github.com/pulumiverse/pulumi-esxi-native/actions/workflows/release.yml)\n\nThe repository is created based on the Terraform Provider [terraform-provider-esxi](https://github.com/josenk/terraform-provider-esxi/tree/master).\nThanks to the wonderful work done there by [@josenk](https://github.com/josenk), I was able to build this provider for Pulumi users.\n\n## IMPORTANT NOTES!\n\n**Note for Pull Requests (PRs)**: When creating a pull request, please do it onto the **MAIN branch** which is\nthe consolidated work-in-progress branch. Do not request it onto another branch.\n\n> **PLEASE** Read our [branch guide](branch-guide.md) to know about our branching policy\n>\n> ### CONTRIBUTING\n>\n> **IMPORTANT:** The contribution details are stated [here](CONTRIBUTING.md)\n\n## Requirements\n-   The VMware [ovftool](https://customerconnect.vmware.com/downloads/get-download?downloadGroup=OVFTOOL443) is required to be installed in the workstation where pulumi will be executed.  \n    > **NOTE:** `ovftool` installer for windows doesn't put ovftool.exe in your path. \n      You will need to manually set your path.\n-   You MUST enable ssh access on your ESXi hypervisor.\n    > Google 'How to enable ssh access on esxi'\n      >- In general, you should know how to use terraform, esxi and some networking...\n* You will most likely need a DHCP server on your primary network if you are deploying VMs with public OVF/OVA/VMX images.  (Sources that have unconfigured primary interfaces.)\n- The source OVF/OVA/VMX images must have open-vm-tools or vmware-tools installed to properly import an IPAddress.  (you need this to run provisioners)\n\n## Features and Compatibility\n\n* Source image can be a clone of a VM or local vmx, ovf, ova file. This provider uses ovftool, so there should be a wide compatibility.\n* Supports adding your VM to Resource Pools to partition CPU and memory usage from other VMs on your ESXi host.\n* Pulumi will Create, Destroy, Update & Import Resource Pools.\n* Pulumi will Create, Destroy, Update & Import Virtual Machines.\n* Pulumi will Create, Destroy, Update & Import Virtual Disks.\n* Pulumi will Create, Destroy, Update & Import Virtual Switches.\n* Pulumi will Create, Destroy, Update & Import Port Groups.\n\n## Why this provider?\n\nIf you do not have a vCenter or vSphere, especially if you are running a home lab, these services are expensive, and maybe you cannot have them, but the ESXi is free, so that is the reason behind it!\n\n## How to install\n\nThe Pulumi ESXi Native provider is available as a package in all Pulumi languages:\n\n* JavaScript/TypeScript: [`@pulumiverse/esxi-native`](https://www.npmjs.com/package/@pulumiverse/esxi-native)\n* Python: [`pulumiverse_esxi_native`](https://pypi.org/project/pulumiverse_esxi_native/)\n* Go: [`github.com/pulumiverse/pulumi-esxi-native/sdk/go/esxi`](https://pkg.go.dev/github.com/pulumiverse/pulumi-esxi-native/sdk/go/esxi)\n* .NET: [`Pulumiverse.EsxiNative`](https://www.nuget.org/packages/Pulumiverse.EsxiNative)\n\n### Provider Binary\n\nThe ESXi Native provider binary is a third party binary. It can be installed using the `pulumi plugin` command.\n\n```bash\npulumi plugin install resource esxi-native <version> --server github://api.github.com/pulumiverse\n```\n\nReplace the `<version>` string with your desired version.\n\n## How to use and configure\n\nIn order to use the provider, we need to provide SSH credentials to the ESXi Host\n\n### Set configuration using `pulumi config`\n\nRemember to pass `--secret` when setting `password` so that it is properly encrypted:\n\n```bash\n$ pulumi config set esxi-native:username <username>\n$ pulumi config set esxi-native:password <password> --secret\n$ pulumi config set esxi-native:host <host IP or FQDN>\n```\n\n### Set configuration using environment variables\n\nFor bash users\n\n```bash\n$ export ESXI_USERNAME=<YOUR_ESXI_USERNAME>\n$ export ESXI_PASSWORD=<YOUR_ESXI_PASSWORD>\n$ export ESXI_HOST=<YOUR_ESXI_HOST_IP>\n```\n\nFor powershell users\n\n```powershell\n> $env:ESXI_USERNAME = \"<YOUR_ESXI_USERNAME>\"\n> $env:ESXI_PASSWORD = \"<YOUR_ESXI_PASSWORD>\"\n> $env:ESXI_HOST = \"<YOUR_ESXI_HOST>\"\n```\n\n### Getting started example\n\n```typescript\nimport * as esxi from \"@pulumiverse/esxi-native\";\n\n\nexport = async () => {\n    const vm = new esxi.VirtualMachine(\"vm-test\", {\n        diskStore: \"nvme-ssd-datastore\",\n        networkInterfaces: [\n            {\n                virtualNetwork: \"default\"\n            }\n        ]\n    });\n\n    return {\n        \"id\": vm.id,\n        \"name\": vm.name,\n        \"os\": vm.os,\n    };\n}\n```\n\n## Known issues with vmware_esxi\n\n* Using a local source vmx files should not have any networks configured. There is very limited network interface mapping abilities in packer for vmx files.  \n  It's best to simply clean out all network information from your vmx file. The plugin will add network configuration to the destination vm guest as required.\n* pulumi import cannot import the guest disk type (thick, thin, etc.) if the VM is powered on and cannot import the guest `ipAddress` if it's powered off.\n* Only `numVCpus` are supported, `numCores` is not.\n* Doesn't support CD-ROM or floppy.\n* Doesn't support Shared bus Interfaces, or Shared disks.\n* Using an incorrect password could lockout your account using default esxi pam settings.\n* Don't set `startupTimeout` or `shutdownTimeout` to 0 (zero). It's valid, however it will be changed to default values.\n\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "VMWare ESXi provider to provision VMs directly on an ESXi hypervisor without a need for vCenter or vSphere.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/pulumiverse/pulumi-esxi-native",
        "Repository": "https://github.com/pulumiverse/pulumi-esxi-native"
    },
    "split_keywords": [
        "pulumi",
        "esxi",
        "esxi-native",
        "category/infrastructure",
        "kind/native"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5df02d70755242f5e2bdbdbaf6ac0f4512e4b765aba71bf89b8483ec6cbf851a",
                "md5": "ba41bdfa92399aa511e189a89ed2cb1b",
                "sha256": "1d7aa6d606081ceea7f38c28652c8e1139898df6f94c52d852a29d3e64a6ee16"
            },
            "downloads": -1,
            "filename": "pulumiverse_esxi_native-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ba41bdfa92399aa511e189a89ed2cb1b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 21686,
            "upload_time": "2023-09-21T19:24:03",
            "upload_time_iso_8601": "2023-09-21T19:24:03.585541Z",
            "url": "https://files.pythonhosted.org/packages/5d/f0/2d70755242f5e2bdbdbaf6ac0f4512e4b765aba71bf89b8483ec6cbf851a/pulumiverse_esxi_native-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-21 19:24:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pulumiverse",
    "github_project": "pulumi-esxi-native",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pulumiverse-esxi-native"
}
        
Elapsed time: 1.05279s