Hi Everyone, I'm a newbie starting with Proxmox. Can anyone help answer my questions? Many thanks!
i have cloned 2 VM to local-lvm from a Template ( VMid: 2010 (Template-U24) by 2 ways
-this is template conf :
bios: seabios
boot: order=sata0;scsi0
cores: 2
cpu: x86-64-v2-AES
memory: 4096
meta: creation-qemu=9.0.2,ctime=179..
name: Template-U24
net0: virtio=XX:XX:XX:XX:XX:XX,bridge=vmbr0
ostype: l26
scsi0: NFS:2010/base-2010-disk-0.qcow2,discard=on,size=12G
scsihw: virtio-scsi-single
smbios1: uuid=9xxxxx....
sockets: 1
tags: template
template: 1
vmgenid: 32xxxxx...
*Second image :
I cloned VM 9004 to local-lvm using the Web UI, and everything is okay. It was very fast because I stored the VM template disk on NFS and mounted it to my Proxmox. Cloning only took 3–4 minutes for a 10GB template. if i migrate template conf to another node then I can clone VM to another node with any storage quickly !
But *First image :
- I have cloned VM 9005 using Terraform with this file: :
# Provider configuration (provider.tf)
terraform {
required_providers {
proxmox = {
source = "telmate/proxmox"
version = "3.0.1-rc4"
}
}
}
provider "proxmox" {
pm_api_url = "https://192.168.100.100:8006/api2/json"
pm_tls_insecure = true
# api token id is in the form of: <username>@pam!<tokenId>
pm_api_token_id = "root@pamPVE"
# this is the full secret wrapped in quotes:
pm_api_token_secret = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
}
resource "proxmox_vm_qemu" "vm-clone" {
name = "terratest-vm"
desc = "A test for using terraform and cloudinit"
target_node = "pve-100-100"
# The template name to clone this vm from
clone = "Template-U24"
full_clone = true
# Activate QEMU agent for this VM
agent = 1
os_type = "cloud-init"
cores = 2
sockets = 1
vcpus = 0
cpu = "host"
memory = 2048
scsihw = "virtio-scsi-pci"
vmid = 9005
# Setup the disk
disks {
scsi {
scsi0 {
disk {
size = 20
cache = "writeback"
storage = "local-lvm"
discard = true
#replicate = true
}
}
}
}
network {
model = "virtio"
bridge = "vmbr0"
tag = xx
}
}
Result : Terraform provisions the 9005 VM's disk to NFS first and then moves it to local-lvm storage.
Why doesn’t Terraform clone the VM directly to local-lvm ??
Last edited: