Initial stab at fio benchmarking resources
This commit is contained in:
parent
cd4cb5291b
commit
0228574e5c
1
openstack/fio_bench/00-init.tf
Symbolic link
1
openstack/fio_bench/00-init.tf
Symbolic link
@ -0,0 +1 @@
|
||||
../00-init.tf
|
9
openstack/fio_bench/00-vars.tf
Normal file
9
openstack/fio_bench/00-vars.tf
Normal file
@ -0,0 +1,9 @@
|
||||
variable "volume_type" {
|
||||
type = string
|
||||
default = "cinder-t3"
|
||||
}
|
||||
|
||||
variable "image" {
|
||||
type = string
|
||||
default = "bionic"
|
||||
}
|
13
openstack/fio_bench/01-flavor.tf
Normal file
13
openstack/fio_bench/01-flavor.tf
Normal file
@ -0,0 +1,13 @@
|
||||
resource "openstack_compute_flavor_v2" "canonical_m1_xlarge_fio" {
|
||||
name = "canonical.m1.xlarge.fio"
|
||||
ram = "16384"
|
||||
vcpus = "8"
|
||||
disk = "160"
|
||||
is_public = true
|
||||
|
||||
extra_specs = {
|
||||
"hw:cpu_policy" = "dedicated",
|
||||
"hw:cpu_thread_policy" = "prefer"
|
||||
"hw:numa_nodes" = "1"
|
||||
}
|
||||
}
|
24
openstack/fio_bench/01-sec-groups.tf
Normal file
24
openstack/fio_bench/01-sec-groups.tf
Normal file
@ -0,0 +1,24 @@
|
||||
resource "openstack_networking_secgroup_v2" "server_secgroup_test" {
|
||||
name = "server_secgroup_test"
|
||||
description = "Allow ssh and ping"
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_rule_v2" "server_secgroup_test_ping" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
protocol = "icmp"
|
||||
port_range_min = -1
|
||||
port_range_max = -1
|
||||
remote_ip_prefix = "0.0.0.0/0"
|
||||
security_group_id = openstack_networking_secgroup_v2.server_secgroup_test.id
|
||||
}
|
||||
|
||||
resource "openstack_networking_secgroup_rule_v2" "server_secgroup_test_ssh" {
|
||||
direction = "ingress"
|
||||
ethertype = "IPv4"
|
||||
protocol = "tcp"
|
||||
port_range_min = 22
|
||||
port_range_max = 22
|
||||
remote_ip_prefix = "0.0.0.0/0"
|
||||
security_group_id = openstack_networking_secgroup_v2.server_secgroup_test.id
|
||||
}
|
24
openstack/fio_bench/02-network.tf
Normal file
24
openstack/fio_bench/02-network.tf
Normal file
@ -0,0 +1,24 @@
|
||||
resource "openstack_networking_network_v2" "network_test" {
|
||||
name = "network_test"
|
||||
admin_state_up = "true"
|
||||
|
||||
segments {
|
||||
physical_network = "physnet_sriov1"
|
||||
segmentation_id = "1498"
|
||||
network_type = "vlan"
|
||||
}
|
||||
}
|
||||
|
||||
resource "openstack_networking_subnet_v2" "subnet_test" {
|
||||
network_id = openstack_networking_network_v2.network_test.id
|
||||
name = "server_test_sn"
|
||||
cidr = "10.0.9.0/24"
|
||||
|
||||
enable_dhcp = "false"
|
||||
|
||||
allocation_pool {
|
||||
start = "10.0.9.36"
|
||||
end = "10.0.9.62"
|
||||
}
|
||||
|
||||
}
|
55
openstack/fio_bench/03-instance.tf
Normal file
55
openstack/fio_bench/03-instance.tf
Normal file
@ -0,0 +1,55 @@
|
||||
data "openstack_images_image_v2" "image" {
|
||||
name = var.image
|
||||
most_recent = true
|
||||
}
|
||||
|
||||
|
||||
resource "openstack_blockstorage_volume_v3" "volume_data" {
|
||||
name = "volume_data"
|
||||
size = 200
|
||||
volume_type = var.volume_type
|
||||
}
|
||||
|
||||
resource "openstack_blockstorage_volume_v3" "volume_boot" {
|
||||
name = "volume_boot"
|
||||
size = 10
|
||||
image_id = data.openstack_images_image_v2.image.id
|
||||
volume_type = var.volume_type
|
||||
}
|
||||
|
||||
resource "openstack_networking_port_v2" "server_port" {
|
||||
name = "server_eth0"
|
||||
network_id = openstack_networking_network_v2.network_test.id
|
||||
admin_state_up = "true"
|
||||
security_group_ids = [openstack_networking_secgroup_v2.server_secgroup_test.id]
|
||||
binding {
|
||||
vnic_type = "direct"
|
||||
}
|
||||
}
|
||||
|
||||
resource "openstack_compute_instance_v2" "server_test" {
|
||||
name = "fio_test_server"
|
||||
image_id = data.openstack_images_image_v2.image.id
|
||||
flavor_id = openstack_compute_flavor_v2.canonical_m1_xlarge_fio.id
|
||||
config_drive = "true"
|
||||
|
||||
block_device {
|
||||
uuid = openstack_blockstorage_volume_v3.volume_boot.id
|
||||
source_type = "volume"
|
||||
boot_index = 0
|
||||
destination_type = "volume"
|
||||
}
|
||||
|
||||
block_device {
|
||||
uuid = openstack_blockstorage_volume_v3.volume_data.id
|
||||
source_type = "volume"
|
||||
boot_index = 1
|
||||
destination_type = "volume"
|
||||
}
|
||||
|
||||
network {
|
||||
port = openstack_networking_port_v2.server_port.id
|
||||
}
|
||||
|
||||
user_data = file("user-data.yaml")
|
||||
}
|
1
openstack/fio_bench/terraform.tfvars
Symbolic link
1
openstack/fio_bench/terraform.tfvars
Symbolic link
@ -0,0 +1 @@
|
||||
../arif-home.tfvars
|
16
openstack/fio_bench/user-data.yaml
Normal file
16
openstack/fio_bench/user-data.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
#cloud-config
|
||||
password: ubuntu
|
||||
chpasswd: {expire: False}
|
||||
ssh_pwauth: True
|
||||
write_files:
|
||||
- content: |
|
||||
#!/bin/bash
|
||||
|
||||
sudo mkfs.ext4 /dev/vdb
|
||||
sudo mkdir /mnt/disk
|
||||
sudo mount /dev/vdb /mnt/disk
|
||||
owner: root
|
||||
permissions: '0755'
|
||||
path: /tmp/mount_disk.sh
|
||||
runcmd:
|
||||
- [ sudo, /tmp/mount_disk.sh ]
|
Loading…
Reference in New Issue
Block a user