Package: pulumi-proxmox
Pulumi Provider for ProxmoxA Pulumi Provider which adds support for Proxmox solutions.based ondanitso/terraform-provider-proxmox, read its docs for details.TODOfix Bug: cannot read configuration from EnvVarsPROXMOX_VE_ENDPOINTPROXMOX_VE_USERNAMEetc.fix github actions, build and upload resource plugin to github releases automatically.set resource plugin download url(github releases).InstallationResources plugin for Linux are available as tarballs in thereleasepage.Follow the installation instructions in release page to install the resource plugin and the python sdk.for other languages, ​​please install sdk from source in thesdkfolder.Build and Install the provider From SourceIn order to properly build the sdks, the following tools are expected:pulumictl(See the project's README for installation instructions:https://github.com/pulumi/pulumictl)to build all the sdks, you need install and set up all the 4 language sdks first: go/dotnet/python/nodejs.then use the following command to build the resource plugin and all the sdks:makebuild_sdksInstall Resource Pluginfirst, build and install resource plugin:makeinstall_resource_pluginNote: Installing package directly from the package registry like pypi/npm/nuget is not supported yet, you need to install package from source viamake.Node.js (Java/TypeScript)makeinstall_nodejs_sdkPythonmakeinstall_python_sdkGoTo use from Go, usego getto grab the latest version of the library$ go get github.com/ryan4yin/pulumi-proxmox/sdk/go/....NETTo use from .NET, use the following command:$ make install_dotnet_sdkConfigurationIn addition toterraform generic provider arguments(e.g.aliasandversion), the following arguments are supported in the Proxmoxproviderblock:virtual_environment- (Optional) The Proxmox Virtual Environment configuration.endpoint- (Required) The endpoint for the Proxmox Virtual Environment API (can also be sourced fromPROXMOX_VE_ENDPOINT).insecure- (Optional) Whether to skip the TLS verification step (can also be sourced fromPROXMOX_VE_INSECURE). If omitted, defaults tofalse.otp- (Optional) The one-time password for the Proxmox Virtual Environment API (can also be sourced fromPROXMOX_VE_OTP).password- (Required) The password for the Proxmox Virtual Environment API (can also be sourced fromPROXMOX_VE_PASSWORD).username- (Required) The username and realm for the Proxmox Virtual Environment API (can also be sourced fromPROXMOX_VE_USERNAME).Examplesset pve Environment variables first:exportPROXMOX_VE_ENDPOINT="https://<server-host>:8006"exportPROXMOX_VE_INSECURE=trueexportPROXMOX_VE_USERNAME=root@pamexportPROXMOX_VE_PASSWORD="<password>"Create VirtualMachine using Python SDK(writing in other languages ​​is almost the same):importosfrompathlibimportPathimportpulumifrompulumi_proxmoximportProvider,ProviderVirtualEnvironmentArgsfrompulumi_proxmox.vmimport*# this provider cannot read configuration from Environment variables yet,# You must manually pass parameters by instantiating a custom providerproxmox_provider=Provider("proxmox-provider",virtual_environment=ProviderVirtualEnvironmentArgs(endpoint=os.getenv("PROXMOX_VE_ENDPOINT"),insecure=os.getenv("PROXMOX_VE_INSECURE")=="true",username=os.getenv("PROXMOX_VE_USERNAME"),password=os.getenv("PROXMOX_VE_PASSWORD")))# create a virtual machineVirtualMachine("ubuntu-vm-0",name="ubuntu-vm-0",description="a ubuntu vm for test",node_name="pve",on_boot=True,# start the vm during system bootupreboot=False,# reboot the vm after it was created successfullystarted=True,# start the vm after it was created successfully# clone from a vm templateclone=VirtualMachineCloneArgs(vm_id=9000,# template's vmIdfull=True,# full clone, not linked clonedatastore_id="local-lvm",# template's datastorenode_name="pve",# template's node name),# resource pool namepool_id="test-resource",cpu=VirtualMachineCpuArgs(cores=2,sockets=2,type="kvm64",# set it to kvm64 for better vm migration),memory=VirtualMachineMemoryArgs(dedicated="4096",# unit: MBshared="4096"),operating_system=VirtualMachineOperatingSystemArgs(type="l26"# l26: linux2.6-linux5.x),agent=VirtualMachineAgentArgs(# please confirm you have qemu-guest-agent in your vm before enable this!# otherwise this may cause the vm to fail to shutdown/reboot!enabled=False,timeout="60s",# timeout),disks=[VirtualMachineDiskArgs(interface="scsi0",datastore_id="local-lvm",size="30",# unit: GB)],network_devices=[VirtualMachineNetworkDeviceArgs(enabled=True,bridge="vmbr0",model="virtio",vlan_id=0,)],# cloud init configurationinitialization=VirtualMachineInitializationArgs(type="nocloud",# 'nocloud' for linux,  'configdrive2' for windowsdatastore_id="local-lvm",dns=VirtualMachineInitializationDnsArgs(# dns servers,server="114.114.114.114,8.8.8.8",),ip_configs=[VirtualMachineInitializationIpConfigArgs(ipv4=VirtualMachineInitializationIpConfigIpv4Args(address="192.168.1.111/24",gateway="192.168.1.1"))],user_account=VirtualMachineInitializationUserAccountArgs(# set root's ssh keykeys=[Path("ssh-common.pub").read_text()],password="chage_me",# needed when login from consoleusername="root",)),# use custom provideropts=pulumi.ResourceOptions(provider=proxmox_provider))Referenceplease readdanitso/terraform-provider-proxmox's docs for details.Developing the Providerall information about sdks are configured inprovider/resources.go, if you want to help me, take a look at it.Related Projectspulumi providers:Matchlighter/pulumi-proxmoxveterraform providers:danitso/terraform-provider-proxmoxTelmate/terraform-provider-proxmox