-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpolicy-diskgroup.tf
96 lines (91 loc) · 2.67 KB
/
policy-diskgroup.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# =============================================================================
# Policy - Disk Group Policy
# -----------------------------------------------------------------------------
# create a RAID mirror between the first two physical disks
resource "intersight_storage_drive_group" "group1" {
name = "${var.policy_prefix}-disk-group"
raid_level = "Raid1"
manual_drive_group = [{
additional_properties = ""
class_id = "storage.ManualDriveGroup"
object_type = "storage.ManualDriveGroup"
dedicated_hot_spares = ""
span_groups = [{
additional_properties = ""
class_id = "storage.SpanDrives"
object_type = "storage.SpanDrives"
slots = "1,2"
}]
}]
virtual_drives = [{
additional_properties = ""
class_id = "storage.VirtualDriveConfiguration"
object_type = "storage.VirtualDriveConfiguration"
boot_drive = false
expand_to_available = true
name = "vd0"
size = 0
virtual_drive_policy = [{
additional_properties = ""
class_id = "storage.VirtualDrivePolicy"
object_type = "storage.VirtualDrivePolicy"
access_policy = "Default"
drive_cache = "Default"
read_policy = "Default"
strip_size = 64
write_policy = "Default"
}]
}]
storage_policy {
moid = intersight_storage_storage_policy.storage1.moid
}
dynamic "tags" {
for_each = var.tags
content {
key = tags.value.key
value = tags.value.value
}
}
}
# # policy that uses the RAID mirror to create a virtual disk called vd0
resource "intersight_storage_storage_policy" "storage1" {
description = var.description
name = "${var.policy_prefix}-storage"
unused_disks_state = "UnconfiguredGood"
use_jbod_for_vd_creation = false
organization {
moid = var.organization
}
dynamic "tags" {
for_each = var.tags
content {
key = tags.value.key
value = tags.value.value
}
}
}
resource "intersight_sdcard_policy" "sdcard1" {
name = "${var.policy_prefix}-sdcard-os"
description = var.description
partitions {
type = "OS"
object_type = "sdcard.Partition"
virtual_drives {
enable = true
object_type = "sdcard.OperatingSystem"
additional_properties = jsonencode({
Name = "Hypervisor"
})
}
}
organization {
moid = var.organization
}
dynamic "tags" {
for_each = var.tags
content {
key = tags.value.key
value = tags.value.value
}
}
}