Skip to content

Commit

Permalink
restore pc example
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroon-Dweikat-Ntx committed Dec 25, 2024
1 parent 9d44274 commit 215310c
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
48 changes: 48 additions & 0 deletions examples/restore_pc_v2/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
terraform {
required_providers {
nutanix = {
source = "nutanix/nutanix"
version = "2.1"
}
}
}

#defining nutanix configuration
provider "nutanix" {
username = var.nutanix_username
password = var.nutanix_password
endpoint = var.nutanix_endpoint
port = 9440
insecure = true
}


resource "nutanix_restore_pc_v2" "example"{
restorable_domain_manager_ext_id = "<domain_manager_uuid>"
restore_source_ext_id = "<restore_source_uuid>"
ext_id = "<restore_point_uuid>"
domain_manager {
config {
name = "example-domain-manager"
size = "SMALL"
}
network {
external_address {
ipv4 {
value = "10.0.0.2"
}
}
ntp_servers {
ipv4 {
value = "10.0.0.22"
}
}
name_servers {
ipv4 {
value = "10.0.0.33"
}
}
}
should_enable_high_availability = true
}
}
13 changes: 13 additions & 0 deletions examples/restore_pc_v2/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#define values to the variables to be used in terraform file
nutanix_username = "admin"
nutanix_password = "password"
nutanix_endpoint = "10.xx.xx.xx"
nutanix_port = 9440

pe_username = "ntnx"
pe_password = "password"

cvm_ip = "10.xx.xx.xx"

new_username = "new_admin"
new_password = "new_password"
31 changes: 31 additions & 0 deletions examples/restore_pc_v2/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#define the type of variables to be used in terraform file
variable "nutanix_username" {
type = string
}
variable "nutanix_password" {
type = string
}
variable "nutanix_endpoint" {
type = string
}
variable "nutanix_port" {
type = string
}
variable "pe_username" {
type = string
}
variable "pe_password" {
type = string
}

variable "cvm_ip" {
type = string
}

variable "new_username" {
type = string
}

variable "new_password" {
type = string
}

0 comments on commit 215310c

Please sign in to comment.