Skip to content

Commit

Permalink
DDM-88-Linux-Machine-For-Oracle (#135)
Browse files Browse the repository at this point in the history
* new oracle machine

* Update migration-vms.tf

* Update prod.tfvars

* Update migration-vms.tf

* Update migration-vms.tf
  • Loading branch information
scott-robertson1 authored Jan 17, 2024
1 parent 1e520df commit 7eb3790
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
63 changes: 63 additions & 0 deletions migration-vms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,67 @@ resource "azurerm_virtual_machine_data_disk_attachment" "mig_datadisk" {
virtual_machine_id = azurerm_linux_virtual_machine.migration-linux[each.key].id
lun = "10"
caching = "ReadWrite"
}

resource "azurerm_linux_virtual_machine" "oracle" {
for_each = var.oracle_linux_vms
name = each.key
location = azurerm_resource_group.darts_migration_resource_group[0].location
resource_group_name = azurerm_resource_group.darts_migration_resource_group[0].name
network_interface_ids = [azurerm_network_interface.migration[0].id]
size = "Standard_D16ds_v4"
tags = var.common_tags
admin_username = var.admin_user
admin_password = random_password.password.result
disable_password_authentication = false

os_disk {
caching = "ReadWrite"
storage_account_type = "Standard_LRS"
}

source_image_reference {
publisher = "RedHat"
offer = "RHEL"
sku = "7.7"
version = "latest"
}
identity {
type = "SystemAssigned"
}
}


resource "azurerm_managed_disk" "oracle_disk" {
for_each = var.oracle_linux_vms
name = "${each.key}-datadisk"
location = azurerm_resource_group.darts_migration_resource_group[0].location
resource_group_name = azurerm_resource_group.darts_migration_resource_group[0].name
storage_account_type = "Premium_LRS"
create_option = "Empty"
disk_size_gb = "8000"
tags = var.common_tags
}

resource "azurerm_virtual_machine_data_disk_attachment" "oracle_datadisk" {
for_each = var.oracle_linux_vms
managed_disk_id = azurerm_managed_disk.migration_disk[each.key].id
virtual_machine_id = azurerm_linux_virtual_machine.migration-linux[each.key].id
lun = "10"
caching = "ReadWrite"
}

resource "azurerm_network_interface" "oracle-linux-nic" {
for_each = var.oracle_linux_vms
name = "${each.key}-nic"
location = azurerm_resource_group.darts_migration_resource_group[0].location
resource_group_name = azurerm_resource_group.darts_migration_resource_group[0].name
tags = var.common_tags

ip_configuration {
name = "oracle-ipconfig"
subnet_id = azurerm_subnet.migration[0].id
private_ip_address_allocation = "Static"
private_ip_address = each.value.ip_address
}
}
5 changes: 5 additions & 0 deletions prod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ migration_linux_vms = {
ip_address = "10.24.239.13"
}
}
oracle_linux_vms = {
prddartsmigora01 = {
ip_address = "10.24.239.15"
}
}

sku_name = "Premium"
family = "P"
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ variable "migration_vms" {
default = {}
}

variable "oracle_linux_vms" {
type = map(object({
ip_address = string
}))
description = "Map of objects describing the migration linux virtual machines to create."
default = {}
}
variable "migration_linux_vms" {
type = map(object({
ip_address = string
Expand Down

0 comments on commit 7eb3790

Please sign in to comment.