Skip to content

Commit 8388355

Browse files
guangleibaocodycushing
authored andcommitted
Refine single instance simple example and volume_attachment.md document (#105)
* 1. Add missing PORT attribute description to volume_attachment.md, 2. Replace 2TB with 256GB to save money and quota, 3. Refine remove-exec.tf for single instance example to make attached volume visible at OS level automatically. * See previous commit message.
1 parent c20da97 commit 8388355

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

docs/examples/compute/single-instance/block.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ resource "baremetal_core_volume" "TFBlock0" {
22
availability_domain = "${lookup(data.baremetal_identity_availability_domains.ADs.availability_domains[var.AD - 1],"name")}"
33
compartment_id = "${var.compartment_ocid}"
44
display_name = "TFBlock0"
5-
size_in_mbs = "${var.2TB}"
5+
size_in_mbs = "${var.256GB}"
66
}
77

88
resource "baremetal_core_volume_attachment" "TFBlock0Attach" {

docs/examples/compute/single-instance/remote-exec.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
resource "null_resource" "remote-exec" {
2-
depends_on = ["baremetal_core_instance.TFInstance"]
2+
depends_on = ["baremetal_core_instance.TFInstance","baremetal_core_volume_attachment.TFBlock0Attach"]
33
provisioner "remote-exec" {
44
connection {
55
agent = false
6-
timeout = "10m"
6+
timeout = "30m"
77
host = "${data.baremetal_core_vnic.InstanceVnic.public_ip_address}"
88
user = "opc"
99
private_key = "${var.ssh_private_key}"
1010
}
1111
inline = [
1212
"touch ~/IMadeAFile.Right.Here",
13+
"sudo iscsiadm -m node -o new -T ${baremetal_core_volume_attachment.TFBlock0Attach.iqn} -p ${baremetal_core_volume_attachment.TFBlock0Attach.ipv4}:${baremetal_core_volume_attachment.TFBlock0Attach.port}",
14+
"sudo iscsiadm -m node -o update -T ${baremetal_core_volume_attachment.TFBlock0Attach.iqn} -n node.startup -v automatic",
15+
"echo sudo iscsiadm -m node -T ${baremetal_core_volume_attachment.TFBlock0Attach.iqn} -p ${baremetal_core_volume_attachment.TFBlock0Attach.ipv4}:${baremetal_core_volume_attachment.TFBlock0Attach.port} -l >> ~/.bashrc"
1316
]
1417
}
1518
}

docs/resources/core/volume_attachment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ The following arguments are supported:
3636
* `chap_username` - The volume's system-generated Challenge-Handshake-Authentication-Protocol (CHAP) user name.
3737
* `chap_secret` - The Challenge-Handshake-Authentication-Protocol (CHAP) secret valid for the associated CHAP user name. (Also called the "CHAP password".)
3838
* `ipv4` - The volume's iSCSI IP address.
39+
* `port` - The volume's iSCSI port.
3940
* `iqn` - The target volume's iSCSI Qualified Name in the format defined by RFC 3720.

0 commit comments

Comments
 (0)