Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Plik zakłada 3 maszyny wirtualne i konfiguruje adresy ip oraz klucze ssh korzystając z cloud-init.



Code Block
resource "proxmox_vm_qemu" proxmox-virt" {

...


   

...


    count = 3

...


    name = "proxmox-virt-${count.index + 1}"

...


    desc = "openstack labitaas kolla controller"

...


    vmid = 1521+count.index

...



    target_node = "hx-core-${count.index + 1}"

...



    pool = "POOL01"

...



    clone = "ubuntu-22-template"

...



    agent = 1

...



    os_type = "cloud-init"

...


    define_connection_info = false

...


    qemu_os = "l26"

...


    cores = 8

...


    sockets = 1

...


    memory = "16384"

...


    scsihw = "virtio-scsi-pci"

...


    bootdisk = "scsi0"

...


    disk {

...


    slot = 0

...


        size = "80G"

...


        type = "scsi"

...


        storage = "STORAGE01"

...


    iothread = 0

...


    }

...



    network {

...


        model = "virtio"

...


        bridge = "vmbr1"

...


    }

...


    network {

...


        model = "virtio"

...


        bridge = "vmbr2"

...


    }

...


    network {

...


        model = "virtio"

...


        bridge = "vmbr3"

...


    }

...



    lifecycle {

...


      ignore_changes  = [

...


        target_node, disk

...


      ]

...


    }

...



 

...

   ipconfig0 = "ip=172.16.1.20${count.index + 1}/20"

...


    ipconfig1 = "ip=172.16.2.20${count.index + 1}/20,gw=172.16.2.254"

...


    ipconfig2 = "ip=172.16.3.20${count.index + 1}/20"

...


    nameserver = "1.1.1.1"

...


    ciuser = var.username

...


    sshkeys = var.sshkeys