mesosphere-backup / packet-terraform Goto Github PK
View Code? Open in Web Editor NEWTerraform scripts for packet.net
Terraform scripts for packet.net
Installed terraform, cloned packet-terraform, configured vars. When I do "terraform apply", I get:
Error applying plan:
2 error(s) occurred:
* packet_device.dcos_master:
* packet_device.dcos_bootstrap:
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
Not very informative error message so I don't know what is wrong really. Any ideas?
Hi,
I am trying to create device on packet.net but getting a below error
root@anand-virtual-machine:~/terform# terraform apply
packet_device.t: Creating...
billing_cycle: "" => "hourly"
created: "" => ""
facility: "" => "sjc1"
hostname: "" => "test1"
locked: "" => ""
network.#: "" => ""
operating_system: "" => "ubuntu_16_04"
plan: "" => "baremetal_0"
project_id: "" => "008d19ce-e5f6-4aab-8f58-025355a363a8"
state: "" => ""
updated: "" => ""
Error applying plan:
1 error(s) occurred:
packet_device.t: 1 error(s) occurred:
packet_device.t: Not found
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
my terraform file:
root@anand-virtual-machine:~/terform# cat test.tf
provider "packet" {
auth_token = "<valid_token>"
}
resource "packet_device" "t" {
hostname = "test1"
operating_system = "ubuntu_16_04"
plan = "baremetal_0"
facility = "sjc1"
project_id = "008d19ce-e5f6-4aab-8f58-025355a363a8"
billing_cycle = "hourly"
}
please help me in resolving this issue.
Thanks,
Anand
A number of times I tried following the official docs and terraform apply
resulted in an infinite chain of
packet_device.dcos_master: Still creating... (XXs elapsed)
When I ctrl-c
out of it, an error appears:
* Failed to read key "./packet-key": no key found
I am using the default settings and have created the ssh key as instructed. I see from hashicorp/terraform#8963 that this is no longer supported:
private_key = "${"file-name"}"
and this is to be used instead:
private_key = "${file("file-name")}"
After making this change, terraform apply
completes.
I tried creating a cluster with only one master and the web ui did not start. Digging further, I saw that the dcos spartan logs showed:
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: [INFO] Clearing proxy environment variables
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: [INFO] No zk.pid last mtime found at /var/lib/dcos/bootstrap/exhibitor_pid_stat
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: [INFO] Shortcut failed, waiting for exhibitor to bring up zookeeper and stabilize
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: [INFO] Expected cluster size: 3
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: [INFO] Waiting for ZooKeeper cluster to stabilize
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: [INFO] Starting new HTTP connection (1): 127.0.0.1
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: Traceback (most recent call last):
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: File "/opt/mesosphere/bin/bootstrap", line 11, in <module>
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: load_entry_point('dcos-internal-utils==0.0.1', 'console_scripts', 'bootstrap')()
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: File "/opt/mesosphere/lib/python3.5/site-packages/dcos_internal_utils/cli.py", line 81, in main
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: exhibitor.wait(opts.master_count)
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: File "/opt/mesosphere/lib/python3.5/site-packages/dcos_internal_utils/exhibitor.py", line 103, in wait
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: raise Exception(msg)
Dec 01 13:33:04 packet-dcos-master-00 bootstrap[19251]: Exception: Expected 3 servers and 1 leader, got 1 servers and 1 leaders
Dec 01 13:33:04 packet-dcos-master-00 systemd[1]: dcos-spartan.service: Control process exited, code=exited status=1
Dec 01 13:33:04 packet-dcos-master-00 systemd[1]: Failed to start DNS Dispatcher: An RFC5625 Compliant DNS Forwarder.
Dec 01 13:33:04 packet-dcos-master-00 systemd[1]: dcos-spartan.service: Unit entered failed state.
Dec 01 13:33:04 packet-dcos-master-00 systemd[1]: dcos-spartan.service: Failed with result 'exit-code'.
I figured the important bit was Exception: Expected 3 servers and 1 leader, got 1 servers and 1 leaders
. Not knowing where this is configured, I just tried creating a new cluster with 3 masters and that seemed to get things working so far.
Is one master not supposed to be supported here? Or is there a fix that can get one master cooking properly?
The vars.tf file references the available packet facilities. the newish Tokyo, JP (NRT1) facility code should be added.
I'm sure people will be burned by the lack of a firewall, leaving the cluster wide open.
It should not be too hard to include a systemd unit with rules for configuring iptables for DC/OS.
I am trying to create my cluster on digitalocean, when I do apply it runs the file dcos.tf which has this block of code, it is not finishing the creation of the master I think because the file ./do-install.sh does not exist on the directory. Can someone help me?
provisioner "local-exec" {
command = "while [ ! -f ./do-install.sh ]; do sleep 1; done"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.