Skip to content

Commit

Permalink
Adding disk format
Browse files Browse the repository at this point in the history
  • Loading branch information
pryorda committed Jan 5, 2020
1 parent 482a3ce commit 3ab2799
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -35,6 +35,7 @@ Usage Example:
| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| datastore | The Storage Pool to deploy the virtual machines to. | string | - | yes |
| disk_format | The virtual disk format. raw, qcow2, vmdk | string | `raw` | no |
| disk_size | The amount of disk space to assign to each VM. | string | `40` | no |
| dns_server | The DNS server to assign to each virtual machine. | string | - | no |
| domain_name | The domain of the virtual machine. This is added as the domain name on Linux, and to the DNS domain search list on both Linux and Windows. | string | `example.com` | no |
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Expand Up @@ -37,7 +37,7 @@ resource "proxmox_vm_qemu" "virtual_machine" {
size = var.disk_size
type = "scsi"
storage = var.datastore
storage_type = "raw"
storage_type = var.disk_format
iothread = false
}

Expand All @@ -50,7 +50,7 @@ resource "proxmox_vm_qemu" "virtual_machine" {

# Setup the ip address using cloud-init.
# Keep in mind to use the CIDR notation for the ip.
ipconfig0 = "ip=dhcp,ip6=dhcp"
ipconfig0 = "ip=dhcp"
nameserver = var.dns_server
searchdomain = var.domain_name
sshkeys = file(var.ssh_public_key)
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Expand Up @@ -58,6 +58,12 @@ variable "qemu_agent" {
default = 0
}

variable "disk_format" {
type = string
description = "The virtual disk format. raw, qcow2, and vmdk"
default = "raw"
}

variable "disk_size" {
type = number
description = "The main disk size in GB"
Expand Down

0 comments on commit 3ab2799

Please sign in to comment.