added deployment script for mac; ensured managed disks are being used
This commit is contained in:
parent
3a77aafe49
commit
1ce99f6929
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -o errexit -o nounset
|
||||||
|
|
||||||
|
# generate a unique string for CI deployment
|
||||||
|
export KEY=$(cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-z' | head -c 12)
|
||||||
|
export PASSWORD=$KEY$(cat /dev/urandom | env LC_CTYPE=C tr -cd 'A-Z' | head -c 2)$(cat /dev/urandom | env LC_CTYPE=C tr -cd '0-9' | head -c 2)
|
||||||
|
|
||||||
|
/bin/sh ./deploy.sh
|
||||||
|
|
||||||
|
### capture vm image
|
||||||
|
# docker run --rm -it \
|
||||||
|
# azuresdk/azure-cli-python \
|
||||||
|
# sh -c "az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant $ARM_TENANT_ID; \
|
||||||
|
# az vm deallocate --name rgvm --resource-group permanent; \
|
||||||
|
# az vm generalize --name rgvm --resource-group permanent; \
|
||||||
|
# az image create --name customImage --source rgvm --resource-group permanent"
|
||||||
|
|
||||||
|
### cleanup
|
||||||
|
# docker run --rm -it \
|
||||||
|
# azuresdk/azure-cli-python \
|
||||||
|
# sh -c "az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant $ARM_TENANT_ID; \
|
||||||
|
# az group delete -y -n $KEY"
|
|
@ -52,17 +52,8 @@ resource "azurerm_storage_container" "storc" {
|
||||||
container_access_type = "private"
|
container_access_type = "private"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_managed_disk" "disk1" {
|
resource "azurerm_managed_disk" "datadisk" {
|
||||||
name = "${var.hostname}-osdisk1"
|
name = "${var.hostname}-datadisk"
|
||||||
location = "${var.location}"
|
|
||||||
resource_group_name = "${azurerm_resource_group.rg.name}"
|
|
||||||
storage_account_type = "Standard_LRS"
|
|
||||||
create_option = "Empty"
|
|
||||||
disk_size_gb = "30"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "azurerm_managed_disk" "disk2" {
|
|
||||||
name = "${var.hostname}-disk2"
|
|
||||||
location = "${var.location}"
|
location = "${var.location}"
|
||||||
resource_group_name = "${azurerm_resource_group.rg.name}"
|
resource_group_name = "${azurerm_resource_group.rg.name}"
|
||||||
storage_account_type = "Standard_LRS"
|
storage_account_type = "Standard_LRS"
|
||||||
|
@ -85,17 +76,18 @@ resource "azurerm_virtual_machine" "vm" {
|
||||||
}
|
}
|
||||||
|
|
||||||
storage_os_disk {
|
storage_os_disk {
|
||||||
name = "${var.hostname}-osdisk1"
|
name = "${var.hostname}-osdisk"
|
||||||
vhd_uri = "${azurerm_storage_account.stor.primary_blob_endpoint}${azurerm_storage_container.storc.name}/${var.hostname}-osdisk1.vhd"
|
managed_disk_type = "Standard_LRS"
|
||||||
caching = "ReadWrite"
|
caching = "ReadWrite"
|
||||||
create_option = "FromImage"
|
create_option = "FromImage"
|
||||||
}
|
}
|
||||||
|
|
||||||
storage_data_disk {
|
storage_data_disk {
|
||||||
name = "${var.hostname}-disk2"
|
name = "${var.hostname}-datadisk"
|
||||||
vhd_uri = "${azurerm_storage_account.stor.primary_blob_endpoint}${azurerm_storage_container.storc.name}/${var.hostname}-disk2.vhd"
|
managed_disk_id = "${azurerm_managed_disk.datadisk.id}"
|
||||||
|
managed_disk_type = "Standard_LRS"
|
||||||
disk_size_gb = "1023"
|
disk_size_gb = "1023"
|
||||||
create_option = "Empty"
|
create_option = "Attach"
|
||||||
lun = 0
|
lun = 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue