Zeebrow / quickhost

Make a publicly available server, quickly
GNU General Public License v3.0
0 stars 0 forks source link

new instances dont have a name #25

Closed Zeebrow closed 2 years ago

Zeebrow commented 2 years ago

main.py make --aws asdf --region us-west-2 was run output

main.py make --aws asdf --region us-west-2
2022-07-08 17:10:42,013 : root : main : DEBUG: loaded 1 plugins
2022-07-08 17:10:42,014 : root : main : DEBUG: first-pass cli_args={'config_file': None, 'aws_app_name': 'asdf', '__qhaction': 'make'}
2022-07-08 17:10:42,014 : root : main : DEBUG: first-pass action_cli_args=['--region', 'us-west-2']
2022-07-08 17:10:42,014 : root : main : DEBUG: action='make'
2022-07-08 17:10:42,015 : quickhost.QuickhostPlugin : load_plugin : DEBUG: Found plugin '[EntryPoint(name='quickhost_aws', value='quickhost_aws:load_plugin', group='quickhost_plugin')]'
2022-07-08 17:10:42,084 : root : main : DEBUG: make_parser params: make_args=Namespace(host_count=1, dry_run=False, ip=None, instance_type='t2.micro', ami=None, userdata=None, region='us-west-2')
2022-07-08 17:10:42,084 : quickhost_aws.AWSApp : run_make : DEBUG: make
args={'host_count': 1, 'dry_run': False, 'ip': None, 'instance_type': 't2.micro', 'ami': None, 'userdata': None, 'region': 'us-west-2'}
proceed? (y/n)y
args={'host_count': 1, 'dry_run': False, 'ip': None, 'instance_type': 't2.micro', 'ami': None, 'userdata': None, 'region': 'us-west-2'}
args={'host_count': 1, 'dry_run': False, 'ip': None, 'instance_type': 't2.micro', 'ami': None, 'userdata': None, 'region': 'us-west-2'}
2022-07-08 17:10:44,026 : quickhost_aws.utilities : get_single_result_id : DEBUG: Found 1 Vpc.
2022-07-08 17:10:44,194 : quickhost_aws.utilities : get_single_result_id : DEBUG: Found 1 Subnet.
2022-07-08 17:10:44,317 : quickhost_aws.utilities : get_single_result_id : DEBUG: Found 1 InternetGateway.
2022-07-08 17:10:44,876 : quickhost_aws.utilities : get_single_result_id : DEBUG: Found 1 RouteTable.
2022-07-08 17:10:46,548 : quickhost_aws.AWSKeypair : describe : ERROR: (InvalidKeyPair.NotFound): DescribeKeyPairs
2022-07-08 17:10:47,048 : quickhost_aws.AWSKeypair : create : DEBUG: saved private key to file '/home/zeebrow/repos/github.com/zeebrow/quickhost/asdf.pem'
Created new key pair (key-0c6dfd5eb1f50c73b)
2022-07-08 17:10:47,857 : quickhost_aws.AWSSG : _add_ingress : ERROR: (Security Group) Unhandled botocore client exception: (MissingParameter): Missing source specification: include source security group or CIDR information
No ami specified, getting latest al2...done (ami-082b5a644766e0e6f)

starting hosts...
*****************
===================Waiting on hosts for 'asdf'=========================
(1/1) Ready: ['i-0efb20917bbfe9c7c'] Waiting: (1): ['i-0efb20917bbfe9c7c']
Done
Traceback (most recent call last):
  File "/home/zeebrow/repos/github.com/zeebrow/quickhost/venv/bin/main.py", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/home/zeebrow/repos/github.com/zeebrow/quickhost/src/scripts/main.py", line 136, in <module>
    rc, fd1, fd2= main()
TypeError: cannot unpack non-iterable int object

aws ec2 describe-instances --instance-id i-0efb20917bbfe9c7c --region us-west-2 --profile quickhost-ci-admin

{
    "Reservations": [
        {
            "Groups": [],
            "Instances": [
                {
                    "AmiLaunchIndex": 0,
                    "ImageId": "ami-082b5a644766e0e6f",
                    "InstanceId": "i-0efb20917bbfe9c7c",
                    "InstanceType": "t2.micro",
                    "KeyName": "asdf",
                    "LaunchTime": "2022-07-08T21:10:50+00:00",
                    "Monitoring": {
                        "State": "disabled"
                    },
                    "Placement": {
                        "AvailabilityZone": "us-west-2b",
                        "GroupName": "",
                        "Tenancy": "default"
                    },
                    "PrivateDnsName": "ip-172-16-0-80.us-west-2.compute.internal",
                    "PrivateIpAddress": "172.16.0.80",
                    "ProductCodes": [],
                    "PublicDnsName": "",
                    "PublicIpAddress": "35.90.20.40",
                    "State": {
                        "Code": 16,
                        "Name": "running"
                    },
                    "StateTransitionReason": "",
                    "SubnetId": "subnet-0191c568cd83e23b2",
                    "VpcId": "vpc-08993887d03942a79",
                    "Architecture": "x86_64",
                    "BlockDeviceMappings": [
                        {
                            "DeviceName": "/dev/xvda",
                            "Ebs": {
                                "AttachTime": "2022-07-08T21:10:51+00:00",
                                "DeleteOnTermination": true,
                                "Status": "attached",
                                "VolumeId": "vol-0ed444390bee6c863"
                            }
                        }
                    ],
                    "ClientToken": "bfb541e7-503c-4c90-8114-4b23823c9db1",
                    "EbsOptimized": false,
                    "EnaSupport": true,
                    "Hypervisor": "xen",
                    "NetworkInterfaces": [
                        {
                            "Association": {
                                "IpOwnerId": "amazon",
                                "PublicDnsName": "",
                                "PublicIp": "35.90.20.40"
                            },
                            "Attachment": {
                                "AttachTime": "2022-07-08T21:10:50+00:00",
                                "AttachmentId": "eni-attach-0be1ae3a3daa54462",
                                "DeleteOnTermination": true,
                                "DeviceIndex": 0,
                                "Status": "attached",
                                "NetworkCardIndex": 0
                            },
                            "Description": "",
                            "Groups": [
                                {
                                    "GroupName": "asdf",
                                    "GroupId": "sg-0f2293c37a3a6ede1"
                                }
                            ],
                            "Ipv6Addresses": [],
                            "MacAddress": "02:ae:c5:3e:73:81",
                            "NetworkInterfaceId": "eni-07f419337789d2f92",
                            "OwnerId": "865386952527",
                            "PrivateIpAddress": "172.16.0.80",
                            "PrivateIpAddresses": [
                                {
                                    "Association": {
                                        "IpOwnerId": "amazon",
                                        "PublicDnsName": "",
                                        "PublicIp": "35.90.20.40"
                                    },
                                    "Primary": true,
                                    "PrivateIpAddress": "172.16.0.80"
                                }
                            ],
                            "SourceDestCheck": true,
                            "Status": "in-use",
                            "SubnetId": "subnet-0191c568cd83e23b2",
                            "VpcId": "vpc-08993887d03942a79",
                            "InterfaceType": "interface"
                        }
                    ],
                    "RootDeviceName": "/dev/xvda",
                    "RootDeviceType": "ebs",
                    "SecurityGroups": [
                        {
                            "GroupName": "asdf",
                            "GroupId": "sg-0f2293c37a3a6ede1"
                        }
                    ],
                    "SourceDestCheck": true,
                    "Tags": [
                        {
                            "Key": "quickhost",
                            "Value": "asdf"
                        }
                    ],
                    "VirtualizationType": "hvm",
                    "CpuOptions": {
                        "CoreCount": 1,
                        "ThreadsPerCore": 1
                    },
                    "CapacityReservationSpecification": {
                        "CapacityReservationPreference": "open"
                    },
                    "HibernationOptions": {
                        "Configured": false
                    },
                    "MetadataOptions": {
                        "State": "applied",
                        "HttpTokens": "optional",
                        "HttpPutResponseHopLimit": 1,
                        "HttpEndpoint": "enabled",
                        "HttpProtocolIpv6": "disabled",
                        "InstanceMetadataTags": "disabled"
                    },
                    "EnclaveOptions": {
                        "Enabled": false
                    },
                    "PlatformDetails": "Linux/UNIX",
                    "UsageOperation": "RunInstances",
                    "UsageOperationUpdateTime": "2022-07-08T21:10:50+00:00",
                    "PrivateDnsNameOptions": {
                        "HostnameType": "ip-name",
                        "EnableResourceNameDnsARecord": false,
                        "EnableResourceNameDnsAAAARecord": false
                    },
                    "MaintenanceOptions": {
                        "AutoRecovery": "default"
                    }
                }
            ],
            "OwnerId": "865386952527",
            "ReservationId": "r-0803fb4ac654a1d98"
        }
    ]
}
Zeebrow commented 2 years ago
Zeebrow commented 2 years ago
while not True:

I actually wrote this line of code.