Metaswitch/chef — pull request #138 by rkd-msw (2014-09-19 12:46:34+00:00)
Title: [Reviewer: Andy] Last bit of per-node DNS entry deletion

Deletion of per-node DNS records on scale-down and on 'knife dns records delete'.

Tested as follows:

```
$ knife dns records delete -E rkd -V
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :type=>"A", :prefix=>"rkd", :subdomain=>"sprout"}
INFO: Deleting record for 'sprout.rkd.cw-ngv.com.'
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :type=>"A", :prefix=>"rkd", :subdomain=>"hs"}
INFO: Deleting record for 'hs.rkd.cw-ngv.com.'
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :type=>"A", :prefix=>"rkd", :subdomain=>"homer"}
INFO: Deleting record for 'homer.rkd.cw-ngv.com.'
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :type=>"A", :prefix=>"rkd", :subdomain=>"ellis"}
INFO: Deleting record for 'ellis.rkd.cw-ngv.com.'
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :type=>"A", :prefix=>"rkd", :subdomain=>""}
INFO: Deleting record for 'rkd.cw-ngv.com.'
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :prefix=>"rkd", :type=>"A", :subdomain=>"bono-1"}
INFO: Deleting record for 'bono-1.rkd.cw-ngv.com.'
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :prefix=>"rkd", :type=>"A", :subdomain=>"ellis-1"}
INFO: Deleting record for 'ellis-1.rkd.cw-ngv.com.'
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :prefix=>"rkd", :type=>"A", :subdomain=>"sprout-1"}
INFO: Deleting record for 'sprout-1.rkd.cw-ngv.com.'
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :prefix=>"rkd", :type=>"A", :subdomain=>"homer-1"}
INFO: Deleting record for 'homer-1.rkd.cw-ngv.com.'
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :prefix=>"rkd", :type=>"A", :subdomain=>"homestead-1"}
INFO: Deleting record for 'homestead-1.rkd.cw-ngv.com.'
```

```
$ knife deployment resize -E rkd --bono-count 2 -V && knife deployment resize -E rkd --bono-count 1 -V && knife deployment resize -E rkd --finish -V
...
INFO: Deleting quiesced boxes...
INFO: delete_record with options {:zone_root=>"cw-ngv.com", :prefix=>"rkd", :type=>"A", :subdomain=>"bono-2"}
INFO: Deleting record for 'bono-2.rkd.cw-ngv.com.'
Searching for node rkd-bono-2 in rkd...
Found node rkd-bono-2 with instance-id i-415fcaaa
Instance ID: i-415fcaaa
Flavor: m1.small
Image: ami-d017b2b8
Region: us-east-1
Availability Zone: us-east-1a
Security Groups: rkd-internal-sip, rkd-bono, rkd-base
SSH Key: dogfood-cw-keypair
Root Device Type: ebs
Public DNS Name: ec2-54-160-152-31.compute-1.amazonaws.com
Public IP Address: 54.160.152.31
Private DNS Name: ip-10-73-186-70.ec2.internal
Private IP Address: 10.73.186.70

WARNING: Deleted server i-415fcaaa
WARNING: Deleted node rkd-bono-2
WARNING: Deleted client rkd-bono-2
...
$ ping bono-2.rkd.cw-ngv.com
ping: unknown host bono-2.rkd.cw-ngv.com
```

Fixes #83.