Skip to content

Instantly share code, notes, and snippets.

View bernadinm's full-sized avatar

Miguel Bernadin bernadinm

  • San Francisco, California
  • 20:18 (UTC -08:00)
View GitHub Profile
@bernadinm
bernadinm / all_aws_managed_policies.json
Created September 6, 2016 23:41 — forked from gene1wood/all_aws_managed_policies.json
A list of all AWS managed policies and they're policy documents as well as a short script to generate the list
{
"AWSAccountActivityAccess": {
"Arn": "arn:aws:iam::aws:policy/AWSAccountActivityAccess",
"AttachmentCount": 0,
"CreateDate": "2015-02-06T18:41:18+00:00",
"DefaultVersionId": "v1",
"Document": {
"Statement": [
{
"Action": [

Guano Restore of Marathon framework ID Procedure

How to revive any orphaned frameworkID using Marathon.

Deploy Marathon-Resurrection JSON

Deploy Marathon-Resurrection JSON. When started successfully, suspend it. It will create the required Zookeeper directories in /universe/marathon-resurrection.

Important NOTE: In order for this procedure to work, it requires a backup of a framework:id that matches the same format that you need replaced. For example, if you want to teardown any framework (not just marathon) a framework ID with this format, {8}-{4}-{4}-{4}-{12}-{4} will need to exist in a zookeeper backup taken previously from marathon or from a different unrelated marathon istance that has the exact format for this procedure to work. (i.e 0cd52b83-52af-4c05-a6e7-45c8d9b8c649-0001 or 12345678-1234-4444-5555-1234567890A-0002 but not 123-34-51-633-0001 as this has format {3}-{2}-{2}-{3}-{4}) See (https://issues.apache.org/jira/browse/MESOS-6419) if you can upgrade Mesos, but this is a qui

@bernadinm
bernadinm / Master Replacement with Static List.md
Last active March 28, 2021 00:17
Procedure to Replace Single Master with Master Discovery Set to Static

Master Replacement with Static List Procedure

Objective: WIth this procedure, we want to replace node 172.31.1.23 with node 172.31.7.30. Also, it is required that we change exhibitor_zk_path to something unique in order for this procedure to work.

Begin

Configure the bootstrap node with the modified config.yaml that has a change to a new exhibitor_zk_path along with the master node that you want to replace for master_list

Important NOTE: The most important piece is exhibitor_storage_backend: zookeeper and exhibitor_zk_path: "/masterip-change-20170127". You must set exhibitor_zk_path to be something unique otherwise your cluster wont converge.

@bernadinm
bernadinm / debug.log
Last active August 30, 2017 22:01
[DEBUG] Azure LoadBalancer Cannot Be Destroyed Dependency
2017/08/30 14:38:15 [INFO] Terraform version: 0.10.2
2017/08/30 14:38:15 [INFO] Go runtime version: go1.8.3
2017/08/30 14:38:15 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.10.2/bin/terraform", "destroy", "--force"}
2017/08/30 14:38:15 [DEBUG] Attempting to open CLI config file: /Users/mbernadin/.terraformrc
2017/08/30 14:38:15 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/08/30 14:38:15 [INFO] CLI command args: []string{"destroy", "--force"}
2017/08/30 14:38:15 [INFO] command: empty terraform config, returning nil
2017/08/30 14:38:15 [DEBUG] command: no data state file found for backend config
2017/08/30 14:38:15 [DEBUG] New state was assigned lineage "02bc3440-e5f2-447b-951a-fb63124fd310"
2017/08/30 14:38:15 [INFO] command: backend initialized: <nil>
@bernadinm
bernadinm / panic.log
Last active August 30, 2017 22:01
[PANIC] Azure LoadBalancer Cannot Be Destroyed Dependency
Error applying plan:
4 error(s) occurred:
* azurerm_lb_rule.public_load_balancer_https_rule (destroy): 1 error(s) occurred:
* azurerm_lb_rule.public_load_balancer_https_rule: Error Creating/Updating LoadBalancer network.LoadBalancersClient#CreateOrUpdate: Failure responding to request: StatusCode=429 -- Original Error: autorest/azure: Service returned an error. Status=429 Code="RetryableError" Message="A retryable error occurred." Details=[{"code":"ReferencedResourceNotProvisioned","message":"Cannot proceed with operation because resource /subscriptions/<subscriptions_id>/resourceGroups/dcos-mbernadin-tfb701/providers/Microsoft.Compute/availabilitySets/mbernadin-tfb701-master-avset used by resource mbernadin-tfb701-pub-mas-elb is not in Succeeded state. Resource is in Updating state and the last operation that updated/is updating the resource is InternalOperation."}]
* azurerm_lb_rule.private_load_balancer_https_rule (destroy): 1 error(s) occurred:
* azurerm_lb_rule.private_load_balancer_https_rule: Error
@bernadinm
bernadinm / worked_on_second_try.log
Created August 31, 2017 00:27
Azure Didn't Make the Priority Change On First Try
mesospheres-MacBook-Pro-8:azure mbernadin$ terraform plan --var os=centos_7.3
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
data.external.whoami: Refreshing state...
data.template_file.os-setup: Refreshing state...
data.template_file.azure_version: Refreshing state...
data.template_file.azure_offer: Refreshing state...
data.template_file.traditional_os_user: Refreshing state...
@bernadinm
bernadinm / destroy_then_immediately_create.log
Created August 31, 2017 17:50
Terraform believe that the resource group is destroyed and when asked to create it again, the Azure api errors.
mesospheres-MacBook-Pro-8:repro mbernadin$ terraform destroy --force
azurerm_resource_group.mb: Refreshing state... (ID: /subscriptions/134r282f-ceda-41d5-a0a8-1251255340c2/resourceGroups/deleteme)
azurerm_public_ip.lb: Refreshing state... (ID: /subscriptions/134r282f-ceda-41d5-a0a8-...rosoft.Network/publicIPAddresses/lb-ip)
azurerm_resource_group.mb: Destroying... (ID: /subscriptions/134r282f-ceda-41d5-a0a8-1251255340c2/resourceGroups/deleteme)
azurerm_resource_group.mb: Still destroying... (ID: /subscriptions/134r282f-ceda-41d5-a0a8-1251255340c2/resourceGroups/deleteme, 10s elapsed)
azurerm_resource_group.mb: Still destroying... (ID: /subscriptions/134r282f-ceda-41d5-a0a8-1251255340c2/resourceGroups/deleteme, 20s elapsed)
azurerm_resource_group.mb: Still destroying... (ID: /subscriptions/134r282f-ceda-41d5-a0a8-1251255340c2/resourceGroups/deleteme, 30s elapsed)
azurerm_resource_group.mb: Still destroying... (ID: /subscriptions/134r282f-ceda-41d5-a0a8-1251255340c2/resourceGroups/deleteme, 40s elapsed)
azurer
Error applying plan:
1 error(s) occurred:
* azurerm_public_ip.node_load_balancer_public_ip: 1 error(s) occurred:
* azurerm_public_ip.node_load_balancer_public_ip: network.PublicIPAddressesClient#CreateOrUpdate: Failure responding to request: StatusCode=429 -- Original Error: autorest/azure: Service returned an error. Status=429 Code="RetryableError" Message="A retryable error occurred." Details=[{"code":"RetryableErrorDueToAnotherOperation","message":"Operation PutPublicIpAddressOperation (ed2bba16-9c2f-41fb-a881-79052f54cf87) is updating resource /subscriptions/b1ed8f2f-ceda-41d5-a0a8-95960b5340c2/resourceGroups/deleteme-038e/providers/Microsoft.Network/publicIPAddresses/lb-ip. The call can be retried in 14 seconds."}]
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
@bernadinm
bernadinm / azure-ip-cannot-be-deleted.log
Created August 31, 2017 21:08
StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="PublicIPAddressCannotBeDeleted" Message="Public IP address load-balancer-ip can not be deleted since it is still allocated to resource load balancer." Details=[]
This file has been truncated, but you can view the full file.
2017/08/31 13:36:12 [INFO] Terraform version: 0.10.2
2017/08/31 13:36:12 [INFO] Go runtime version: go1.8.3
2017/08/31 13:36:12 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.10.2/bin/terraform", "destroy", "--force"}
2017/08/31 13:36:12 [DEBUG] Attempting to open CLI config file: /Users/mbernadin/.terraformrc
2017/08/31 13:36:12 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/08/31 13:36:12 [INFO] CLI command args: []string{"destroy", "--force"}
2017/08/31 13:36:12 [INFO] command: empty terraform config, returning nil
2017/08/31 13:36:12 [DEBUG] command: no data state file found for backend config
2017/08/31 13:36:12 [DEBUG] New state was assigned lineage "d78ea0e1-951c-4f5e-837a-5e9da3bce6bd"
2017/08/31 13:36:12 [INFO] command: backend initialized: <nil>
@bernadinm
bernadinm / azure-ip-cannot-be-deleted.log
Created August 31, 2017 21:08
StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="PublicIPAddressCannotBeDeleted" Message="Public IP address load-balancer-ip can not be deleted since it is still allocated to resource load balancer." Details=[]
This file has been truncated, but you can view the full file.
2017/08/31 13:36:12 [INFO] Terraform version: 0.10.2
2017/08/31 13:36:12 [INFO] Go runtime version: go1.8.3
2017/08/31 13:36:12 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.10.2/bin/terraform", "destroy", "--force"}
2017/08/31 13:36:12 [DEBUG] Attempting to open CLI config file: /Users/mbernadin/.terraformrc
2017/08/31 13:36:12 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/08/31 13:36:12 [INFO] CLI command args: []string{"destroy", "--force"}
2017/08/31 13:36:12 [INFO] command: empty terraform config, returning nil
2017/08/31 13:36:12 [DEBUG] command: no data state file found for backend config
2017/08/31 13:36:12 [DEBUG] New state was assigned lineage "d78ea0e1-951c-4f5e-837a-5e9da3bce6bd"
2017/08/31 13:36:12 [INFO] command: backend initialized: <nil>