From 52faea3e67e7cfa0eed0029fec4e760d9348b131 Mon Sep 17 00:00:00 2001 From: Chris Long Date: Thu, 6 Dec 2018 23:47:26 -0800 Subject: [PATCH 1/2] Override virtualbox NIC type Addressing https://github.com/clong/DetectionLab/issues/170 --- Vagrant/Vagrantfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Vagrant/Vagrantfile b/Vagrant/Vagrantfile index 8c29ffa..017dc60 100644 --- a/Vagrant/Vagrantfile +++ b/Vagrant/Vagrantfile @@ -87,6 +87,7 @@ Vagrant.configure("2") do |config| cfg.vm.provider "virtualbox" do |vb, override| vb.gui = true vb.name = "dc.windomain.local" + vb.default_nic_type = "82545EM" vb.customize ["modifyvm", :id, "--memory", 2560] vb.customize ["modifyvm", :id, "--cpus", 2] vb.customize ["modifyvm", :id, "--vram", "32"] @@ -145,6 +146,7 @@ Vagrant.configure("2") do |config| cfg.vm.provider "virtualbox" do |vb, override| vb.gui = true vb.name = "wef.windomain.local" + vb.default_nic_type = "82545EM" vb.customize ["modifyvm", :id, "--memory", 2048] vb.customize ["modifyvm", :id, "--cpus", 2] vb.customize ["modifyvm", :id, "--vram", "32"] @@ -204,6 +206,7 @@ Vagrant.configure("2") do |config| cfg.vm.provider "virtualbox" do |vb, override| vb.gui = true vb.name = "win10.windomain.local" + vb.default_nic_type = "82545EM" vb.customize ["modifyvm", :id, "--memory", 2048] vb.customize ["modifyvm", :id, "--cpus", 1] vb.customize ["modifyvm", :id, "--vram", "32"] From 0f5d5b95b4b231ff706695c6894fdb93c3373a3c Mon Sep 17 00:00:00 2001 From: Chris Long Date: Fri, 7 Dec 2018 00:17:34 -0800 Subject: [PATCH 2/2] Add a backup for CI build provisioning --- ci/circle_workflows/vagrant_changes.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci/circle_workflows/vagrant_changes.sh b/ci/circle_workflows/vagrant_changes.sh index 27c9d22..a0f4943 100644 --- a/ci/circle_workflows/vagrant_changes.sh +++ b/ci/circle_workflows/vagrant_changes.sh @@ -14,7 +14,13 @@ DEVICE_ID=$(curl -s -X POST --header 'Accept: application/json' --header 'Conten # TODO: maybe make this a regex if [ "$(echo -n $DEVICE_ID | wc -c)" -ne 36 ]; then echo "Server may have failed provisionining. Device ID is set to: $DEVICE_ID" - exit 1 + echo "This usually happens if there are no servers available in the selected datacenter." + echo "Attempting to retry in another datacenter..." + DEVICE_ID=$(curl -s -X POST --header 'Accept: application/json' --header 'Content-Type: application/json' --header 'X-Auth-Token: '"$PACKET_API_TOKEN" -d '{ "facility": "ewr1", "plan": "baremetal_1", "hostname": "detectionlab", "description": "testing", "billing_cycle": "hourly", "operating_system": "ubuntu_16_04", "userdata": "", "locked": "false", "project_ssh_keys": ["315a9565-d5b1-41b6-913d-fcf022bb89a6", "755b134a-f63c-4fc5-9103-c1b63e65fdfc"] }' 'https://api.packet.net/projects/0b3f4f2e-ff05-41a8-899d-7923f620ca85/devices' | jq ."id" | tr -d '"') + if [ "$(echo -n $DEVICE_ID | wc -c)" -ne 36 ]; then + echo "This script was still unable to successfully provision a server. Exiting." + exit 1 + fi fi echo "Server successfully provisioned with ID: $DEVICE_ID"