Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
use dc n0stack for test
Browse files Browse the repository at this point in the history
  • Loading branch information
onokatio committed Dec 28, 2019
1 parent 95f9ae8 commit a43597e
Showing 1 changed file with 11 additions and 40 deletions.
51 changes: 11 additions & 40 deletions test.tf
Original file line number Diff line number Diff line change
@@ -1,68 +1,39 @@
provider "n0stack" {
endpoint = "192.168.1.31:20180"
endpoint = "172.16.14.10:20180"
}

resource "n0stack_blockstorage" "FetchUbuntuDisk" {
blockstorage_name = "ubuntu-bionic"
annotations = {
"n0core/provisioning/block_storage/request_node_name" = "archlinux"
}
labels = {
label1 = "hoge"
}
request_bytes = 1073741824
limit_bytes = 10737418240
source_url = "http://localhost/bionic-server-cloudimg-amd64.img"
}

resource "n0stack_image" "RegisterUbuntuAsImageLatest" {
image_name = "ubuntu-bionic-image"
tags = ["latest"]
blockstorage_name = "ubuntu-bionic"

depends_on = [n0stack_blockstorage.FetchUbuntuDisk]
}


resource "n0stack_blockstorage" "CreateNewDiskFromImage" {
image_name = "ubuntu-bionic-image"
resource "n0stack_blockstorage" "MyDiskFromImage" {
image_name = "baseimage-ubuntu"
tag = "latest"
blockstorage_name = "test-disk"
blockstorage_name = "MyDisk"
annotations = {
"n0core/provisioning/block_storage/request_node_name" = "archlinux"
"n0core/provisioning/block_storage/request_node_name" = "n0node00"
}
request_bytes = 1073741824
limit_bytes = 10737418240

depends_on = [n0stack_image.RegisterUbuntuAsImageLatest]
}

resource "n0stack_network" "CreateNetwork" {
name = "test-network"
resource "n0stack_network" "MyNetwork" {
name = "MyNetwork"
ipv4_cidr = "192.168.100.0/24"
annotations = {
"n0core/provisioning/block_storage/request_node_name" = "archlinux"
"n0core/provisioning/virtual_machine/vlan_id" = "126"
}
}

resource "n0stack_virtualmachine" "CreateVM" {
name = "test-vm"
annotations = {
"n0core/provisioning/virtual_machine/request_node_name" = "archlinux"
"n0core/provisioning/virtual_machine/request_node_name" = "n0node00"
}
request_cpu_milli_core = 10
limit_cpu_milli_core = 1000
request_memory_bytes = 536870912
limit_memory_bytes = 536870912
block_storage_names = ["test-disk"]
block_storage_names = [n0stack_blockstorage.MyDiskFromImage.blockstorage_name]

nics {
network_name = "test-network"
network_name = n0stack_network.MyNetwork.name
ipv4_address = "192.168.100.1"
}

depends_on = [
n0stack_blockstorage.CreateNewDiskFromImage,
n0stack_network.CreateNetwork,
]
}

0 comments on commit a43597e

Please sign in to comment.