tweaking configuration to at least provision a VM
This commit is contained in:
parent
4f8ac31931
commit
631afcafba
@ -4,11 +4,36 @@ data "proxmox_virtual_environment_vms" "template" {
|
|||||||
values = ["ubuntu-cloud"]
|
values = ["ubuntu-cloud"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# resource "proxmox_virtual_environment_file" "cloud_config" {
|
||||||
|
# content_type = "snippets"
|
||||||
|
# datastore_id = "local"
|
||||||
|
# node_name = "zenith"
|
||||||
|
|
||||||
|
# source_raw {
|
||||||
|
# data = <<-EOF
|
||||||
|
# #cloud-config
|
||||||
|
# hostname: simple-vm
|
||||||
|
# packages:
|
||||||
|
# - qemu-guest-agent
|
||||||
|
# users:
|
||||||
|
# - default
|
||||||
|
# - name: vez
|
||||||
|
# groups: sudo
|
||||||
|
# shell: /bin/bash
|
||||||
|
# ssh-authorized-keys:
|
||||||
|
# - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICxWxrBF6W6N2ZrzoKhTwDTZ49tlYzvki+4naHjo8DhB vez-key"
|
||||||
|
# sudo: ALL=(ALL) NOPASSWD:ALL
|
||||||
|
# EOF
|
||||||
|
|
||||||
|
# file_name = "example.cloud-config.yaml"
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
|
||||||
resource "proxmox_virtual_environment_vm" "simple_vm" {
|
resource "proxmox_virtual_environment_vm" "simple_vm" {
|
||||||
name = "simple-vm"
|
name = "simple-vm"
|
||||||
node_name = "zenith"
|
node_name = "zenith"
|
||||||
tags = ["terraform", "test"]
|
tags = ["test"]
|
||||||
|
|
||||||
|
|
||||||
agent {
|
agent {
|
||||||
enabled = false
|
enabled = false
|
||||||
@ -16,49 +41,59 @@ resource "proxmox_virtual_environment_vm" "simple_vm" {
|
|||||||
# if agent is not enabled, the VM may not be able to shutdown properly, and may need to be forced off
|
# if agent is not enabled, the VM may not be able to shutdown properly, and may need to be forced off
|
||||||
stop_on_destroy = true
|
stop_on_destroy = true
|
||||||
|
|
||||||
|
|
||||||
clone {
|
clone {
|
||||||
vm_id = data.proxmox_virtual_environment_vms.template.vms[0].vm_id
|
vm_id = data.proxmox_virtual_environment_vms.template.vms[0].vm_id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bios = "ovmf"
|
||||||
|
machine = "q35"
|
||||||
|
|
||||||
cpu {
|
cpu {
|
||||||
cores = 2
|
cores = 2
|
||||||
type = "x86-64-v2-AES" # recommended for modern CPUs
|
type = "host"
|
||||||
}
|
}
|
||||||
|
|
||||||
memory {
|
memory {
|
||||||
dedicated = 2048
|
dedicated = 2048
|
||||||
floating = 2048 # set equal to dedicated to enable ballooning
|
|
||||||
}
|
}
|
||||||
|
|
||||||
disk {
|
disk {
|
||||||
datastore_id = "ceph-workload"
|
datastore_id = "ceph-workload"
|
||||||
#file_id = proxmox_virtual_environment_download_file.latest_ubuntu_22_jammy_qcow2_img.id
|
#file_id = proxmox_virtual_environment_download_file.latest_ubuntu_22_jammy_qcow2_img.id
|
||||||
interface = "scsi0"
|
interface = "scsi0"
|
||||||
|
size = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
initialization {
|
initialization {
|
||||||
|
datastore_id = "ceph-workload"
|
||||||
|
interface = "scsi1"
|
||||||
|
|
||||||
ip_config {
|
ip_config {
|
||||||
ipv4 {
|
ipv4 {
|
||||||
address = "dhcp"
|
address = "dhcp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#user_account {
|
user_account {
|
||||||
# keys = [trimspace(tls_private_key.ubuntu_vm_key.public_key_openssh)]
|
keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICxWxrBF6W6N2ZrzoKhTwDTZ49tlYzvki+4naHjo8DhB vez-key"]
|
||||||
# password = random_password.ubuntu_vm_password.result
|
username = "vez"
|
||||||
# username = "ubuntu"
|
}
|
||||||
#}
|
|
||||||
|
|
||||||
#user_data_file_id = proxmox_virtual_environment_file.cloud_config.id
|
#user_data_file_id = proxmox_virtual_environment_file.cloud_config.id
|
||||||
}
|
}
|
||||||
|
|
||||||
network_device {
|
network_device {
|
||||||
bridge = "vmbr0"
|
bridge = "vmbr0"
|
||||||
|
vlan_id = 66
|
||||||
}
|
}
|
||||||
|
|
||||||
operating_system {
|
operating_system {
|
||||||
type = "l26"
|
type = "l26"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vga {
|
||||||
|
type = "std"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ provider "proxmox" {
|
|||||||
api_token = var.proxmox_api_token
|
api_token = var.proxmox_api_token
|
||||||
insecure = false
|
insecure = false
|
||||||
ssh {
|
ssh {
|
||||||
agent = true
|
agent = false
|
||||||
username = "root"
|
#username = "root"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user