-
-
Save anonymous/0cf3c50c9ec2baaecfdc43ed152b93d0 to your computer and use it in GitHub Desktop.
python3 salt-cloud doesnt accept keyfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@controller4 ~]# salt-cloud -f list_nodes AWS-brawl-sandbox01 --out=pprint -l debug | |
[DEBUG ] Reading configuration from /etc/salt/cloud | |
[DEBUG ] Including configuration from '/etc/salt/cloud.conf.d/cloud.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.conf.d/cloud.conf | |
[DEBUG ] Reading configuration from /etc/salt/master | |
[DEBUG ] Including configuration from '/etc/salt/master.d/master.conf' | |
[DEBUG ] Reading configuration from /etc/salt/master.d/master.conf | |
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: ip-10-90-14-92 | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers | |
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/aws-provider.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/aws-provider.conf | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-analysis.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-analysis.conf | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-gameboard.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-gameboard.conf | |
[DEBUG ] Configuration file path: /etc/salt/cloud | |
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged. | |
[INFO ] salt-cloud starting | |
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False | |
[DEBUG ] LazyLoaded parallels.avail_locations | |
[DEBUG ] LazyLoaded proxmox.avail_sizes | |
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available. | |
[DEBUG ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available. | |
[DEBUG ] LazyLoaded openstack.list_locations | |
[DEBUG ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available. | |
[DEBUG ] Trying to execute 'ec2.list_nodes' with the following kwargs: {} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] LazyLoaded cloud.cache_node_list | |
[DEBUG ] LazyLoaded pprint.output | |
{'AWS-brawl-sandbox01': {'ec2': {'Controller2': {'id': 'i-086341be85c92a067', | |
'image': 'ami-ae7bfdb8', | |
'name': 'Controller2', | |
'private_ips': '10.90.14.141', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'cmd-vm': {'id': 'i-01dab8de377758b51', | |
'image': 'ami-ae7bfdb8', | |
'name': 'cmd-vm', | |
'private_ips': '10.90.14.29', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'controller': {'id': 'i-099950754fb58164f', | |
'image': 'ami-ae7bfdb8', | |
'name': 'controller', | |
'private_ips': '10.90.14.181', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'controller-new': {'id': 'i-05a3f2b85bf6cd4f1', | |
'image': 'ami-ae7bfdb8', | |
'name': 'controller-new', | |
'private_ips': '10.90.14.121', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'controller4': {'id': 'i-085680800ba0896b9', | |
'image': 'ami-ae7bfdb8', | |
'name': 'controller4', | |
'private_ips': '10.90.14.92', | |
'public_ips': '54.226.129.76', | |
'size': 't2.micro', | |
'state': 'running'}}}} | |
[root@controller4 ~]# salt-cloud -p AWS-brawl-sandbox01-analysis-linux-tiny test-vm -l debug | |
[DEBUG ] Reading configuration from /etc/salt/cloud | |
[DEBUG ] Including configuration from '/etc/salt/cloud.conf.d/cloud.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.conf.d/cloud.conf | |
[DEBUG ] Reading configuration from /etc/salt/master | |
[DEBUG ] Including configuration from '/etc/salt/master.d/master.conf' | |
[DEBUG ] Reading configuration from /etc/salt/master.d/master.conf | |
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: ip-10-90-14-92 | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers | |
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/aws-provider.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/aws-provider.conf | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-analysis.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-analysis.conf | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-gameboard.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-gameboard.conf | |
[DEBUG ] Configuration file path: /etc/salt/cloud | |
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged. | |
[INFO ] salt-cloud starting | |
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False | |
[DEBUG ] LazyLoaded parallels.avail_locations | |
[DEBUG ] LazyLoaded proxmox.avail_sizes | |
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available. | |
[DEBUG ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available. | |
[DEBUG ] LazyLoaded openstack.list_locations | |
[DEBUG ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available. | |
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False | |
[DEBUG ] LazyLoaded parallels.avail_locations | |
[DEBUG ] LazyLoaded proxmox.avail_sizes | |
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available. | |
[DEBUG ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available. | |
[DEBUG ] LazyLoaded openstack.list_locations | |
[DEBUG ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available. | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] LazyLoaded cloud.cache_node_list | |
[DEBUG ] Generating minion keys for 'test-vm' | |
[DEBUG ] LazyLoaded cloud.fire_event | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/test-vm/creating; data = {'profile': 'AWS-brawl-sandbox01-analysis-linux-tiny', 'event': 'starting create', '_stamp': '2017-10-06T13:37:01.984941', 'name': 'test-vm', 'provider': 'AWS-brawl-sandbox01:ec2'} | |
[INFO ] Creating Cloud VM test-vm in us-east-1 | |
[DEBUG ] Create network interface: {'SubnetId': 'subnet-16b1a35e', 'DeviceIndex': 0, 'SecurityGroupId': 'sg-a3bee9d3', 'PrivateIpAddresses': [{'Primary': True}]} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeSubnets&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=CreateNetworkInterface&PrivateIpAddresses.0.Primary=true&SecurityGroupId=sg-a3bee9d3&SubnetId=subnet-16b1a35e&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Created network interface eni-a1bb811f inst 0 | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/test-vm/requesting; data = {'event': 'requesting instance', '_stamp': '2017-10-06T13:37:02.845383', 'location': 'us-east-1', 'kwargs': {'NetworkInterface.0.DeviceIndex': 0, 'ImageId': 'ami-ae7bfdb8', 'KeyName': 'BRAWL-Team_Sandbox1', 'MaxCount': 1, 'Action': 'RunInstances', 'MinCount': 1, 'NetworkInterface.0.NetworkInterfaceId': 'eni-a1bb811f', 'InstanceType': 't2.micro'}} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=RunInstances&ImageId=ami-ae7bfdb8&InstanceType=t2.micro&KeyName=BRAWL-Team_Sandbox1&MaxCount=1&MinCount=1&NetworkInterface.0.DeviceIndex=0&NetworkInterface.0.NetworkInterfaceId=eni-a1bb811f&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/test-vm/querying; data = {'instance_id': 'i-0c473878c1c6b8753', '_stamp': '2017-10-06T13:37:04.021771', 'event': 'querying instance'} | |
[DEBUG ] The new VM instance_id is i-0c473878c1c6b8753 | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&InstanceId.1=i-0c473878c1c6b8753&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] The query returned: [{'ownerId': '677998037804', 'groupSet': None, 'reservationId': 'r-0d918ba0ab95acb4c', 'instancesSet': {'item': {'productCodes': None, 'vpcId': 'vpc-9dac9de4', 'instanceId': 'i-0c473878c1c6b8753', 'imageId': 'ami-ae7bfdb8', 'keyName': 'BRAWL-Team_Sandbox1', 'clientToken': None, 'subnetId': 'subnet-16b1a35e', 'amiLaunchIndex': '0', 'instanceType': 't2.micro', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'monitoring': {'state': 'disabled'}, 'dnsName': None, 'privateIpAddress': '10.90.14.171', 'virtualizationType': 'hvm', 'privateDnsName': 'ip-10-90-14-171.ec2.internal', 'reason': None, 'sourceDestCheck': 'true', 'blockDeviceMapping': None, 'placement': {'groupName': None, 'tenancy': 'default', 'availabilityZone': 'us-east-1a'}, 'instanceState': {'code': '0', 'name': 'pending'}, 'networkInterfaceSet': {'item': {'status': 'in-use', 'macAddress': '0a:de:9f:97:53:f6', 'sourceDestCheck': 'true', 'vpcId': 'vpc-9dac9de4', 'description': None, 'networkInterfaceId': 'eni-a1bb811f', 'privateDnsName': 'ip-10-90-14-171.ec2.internal', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'attachment': {'status': 'attaching', 'deviceIndex': '0', 'deleteOnTermination': 'false', 'attachmentId': 'eni-attach-166a17e5', 'attachTime': '2017-10-06T13:37:03.000Z'}, 'subnetId': 'subnet-16b1a35e', 'ownerId': '677998037804', 'privateIpAddressesSet': {'item': {'privateDnsName': 'ip-10-90-14-171.ec2.internal', 'primary': 'true', 'privateIpAddress': '10.90.14.171'}}, 'privateIpAddress': '10.90.14.171'}}, 'ebsOptimized': 'false', 'launchTime': '2017-10-06T13:37:03.000Z', 'architecture': 'x86_64', 'hypervisor': 'xen', 'rootDeviceType': 'ebs', 'rootDeviceName': '/dev/sda1'}}}] | |
[DEBUG ] Waiting for VM IP. Giving up in 00:10:00. | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&InstanceId.1=i-0c473878c1c6b8753&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Returned query data: [{'ownerId': '677998037804', 'groupSet': None, 'reservationId': 'r-0d918ba0ab95acb4c', 'instancesSet': {'item': {'productCodes': None, 'vpcId': 'vpc-9dac9de4', 'instanceId': 'i-0c473878c1c6b8753', 'imageId': 'ami-ae7bfdb8', 'keyName': 'BRAWL-Team_Sandbox1', 'clientToken': None, 'subnetId': 'subnet-16b1a35e', 'amiLaunchIndex': '0', 'instanceType': 't2.micro', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'monitoring': {'state': 'disabled'}, 'dnsName': None, 'privateIpAddress': '10.90.14.171', 'virtualizationType': 'hvm', 'privateDnsName': 'ip-10-90-14-171.ec2.internal', 'reason': None, 'sourceDestCheck': 'true', 'blockDeviceMapping': {'item': {'deviceName': '/dev/sda1', 'ebs': {'status': 'attaching', 'deleteOnTermination': 'false', 'volumeId': 'vol-057b7ff36a3e1a479', 'attachTime': '2017-10-06T13:37:04.000Z'}}}, 'placement': {'groupName': None, 'tenancy': 'default', 'availabilityZone': 'us-east-1a'}, 'instanceState': {'code': '0', 'name': 'pending'}, 'networkInterfaceSet': {'item': {'status': 'in-use', 'macAddress': '0a:de:9f:97:53:f6', 'sourceDestCheck': 'true', 'vpcId': 'vpc-9dac9de4', 'description': None, 'networkInterfaceId': 'eni-a1bb811f', 'privateDnsName': 'ip-10-90-14-171.ec2.internal', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'attachment': {'status': 'attaching', 'deviceIndex': '0', 'deleteOnTermination': 'false', 'attachmentId': 'eni-attach-166a17e5', 'attachTime': '2017-10-06T13:37:03.000Z'}, 'subnetId': 'subnet-16b1a35e', 'ownerId': '677998037804', 'privateIpAddressesSet': {'item': {'privateDnsName': 'ip-10-90-14-171.ec2.internal', 'primary': 'true', 'privateIpAddress': '10.90.14.171'}}, 'privateIpAddress': '10.90.14.171'}}, 'ebsOptimized': 'false', 'launchTime': '2017-10-06T13:37:03.000Z', 'architecture': 'x86_64', 'hypervisor': 'xen', 'rootDeviceType': 'ebs', 'rootDeviceName': '/dev/sda1'}}}] | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/test-vm/tagging; data = {'_stamp': '2017-10-06T13:37:05.055994', 'event': 'setting tags', 'tags': {'Name': 'test-vm'}} | |
[DEBUG ] Attempting function <function set_tags at 0x3873488> | |
[DEBUG ] Tags to set for test-vm: {'Name': 'test-vm'} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=CreateTags&ResourceId.1=i-0c473878c1c6b8753&Tag.0.Key=Name&Tag.0.Value=test-vm&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeTags&Filter.1.Name=resource-id&Filter.1.Value=i-0c473878c1c6b8753&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Setting the tags returned: [{'resourceType': 'instance', 'resourceId': 'i-0c473878c1c6b8753', 'value': 'test-vm', 'key': 'Name'}] | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=ModifyNetworkInterfaceAttribute&Attachment.AttachmentId=eni-attach-166a17e5&Attachment.DeleteOnTermination=True&NetworkInterfaceId=eni-a1bb811f&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[INFO ] Created node test-vm | |
[INFO ] Salt node data. Private_ip: 10.90.14.171 | |
[INFO ] Salt interface set to: 10.90.14.171 | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/test-vm/waiting_for_ssh; data = {'_stamp': '2017-10-06T13:37:06.537049', 'ip_address': '10.90.14.171', 'event': 'waiting for ssh'} | |
[DEBUG ] Attempting connection to host 10.90.14.171 on port 445 | |
[DEBUG ] Caught exception in wait_for_port: timed out | |
[DEBUG ] Retrying connection to host 10.90.14.171 on port 445 (try 1) | |
^C | |
Exiting gracefully on Ctrl-c | |
[root@controller4 ~]# salt-cloud --version | |
salt-cloud 2016.11.7 (Carbon) | |
[root@controller4 ~]# pip3 install salt==2016.11.7 | |
Collecting salt==2016.11.7 | |
Using cached salt-2016.11.7.tar.gz | |
Requirement already satisfied: Jinja2 in /usr/local/lib/python3.5/site-packages (from salt==2016.11.7) | |
Requirement already satisfied: msgpack-python>0.3 in /usr/local/lib/python3.5/site-packages (from salt==2016.11.7) | |
Requirement already satisfied: PyYAML in /usr/local/lib/python3.5/site-packages (from salt==2016.11.7) | |
Requirement already satisfied: MarkupSafe in /usr/local/lib/python3.5/site-packages (from salt==2016.11.7) | |
Requirement already satisfied: requests>=1.0.0 in /usr/local/lib/python3.5/site-packages (from salt==2016.11.7) | |
Requirement already satisfied: tornado>=4.2.1 in /usr/local/lib/python3.5/site-packages (from salt==2016.11.7) | |
Requirement already satisfied: pycrypto>=2.6.1 in /usr/local/lib/python3.5/site-packages (from salt==2016.11.7) | |
Requirement already satisfied: pyzmq>=2.2.0 in /usr/local/lib/python3.5/site-packages (from salt==2016.11.7) | |
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.5/site-packages (from requests>=1.0.0->salt==2016.11.7) | |
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/local/lib/python3.5/site-packages (from requests>=1.0.0->salt==2016.11.7) | |
Requirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python3.5/site-packages (from requests>=1.0.0->salt==2016.11.7) | |
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.5/site-packages (from requests>=1.0.0->salt==2016.11.7) | |
Installing collected packages: salt | |
Running setup.py install for salt ... done | |
Successfully installed salt-2016.11.7 | |
[root@controller4 ~]# salt-cloud -f list_nodes AWS-brawl-sandbox01 --out=pprint -l debug | |
[DEBUG ] Reading configuration from /etc/salt/cloud | |
[DEBUG ] Including configuration from '/etc/salt/cloud.conf.d/cloud.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.conf.d/cloud.conf | |
[DEBUG ] Reading configuration from /etc/salt/master | |
[DEBUG ] Including configuration from '/etc/salt/master.d/master.conf' | |
[DEBUG ] Reading configuration from /etc/salt/master.d/master.conf | |
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: ip-10-90-14-92 | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers | |
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/aws-provider.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/aws-provider.conf | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-analysis.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-analysis.conf | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-gameboard.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-gameboard.conf | |
[DEBUG ] Configuration file path: /etc/salt/cloud | |
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged. | |
[INFO ] salt-cloud starting | |
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False | |
[DEBUG ] LazyLoaded parallels.avail_locations | |
[DEBUG ] LazyLoaded proxmox.avail_sizes | |
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available. | |
[DEBUG ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available. | |
[DEBUG ] LazyLoaded openstack.list_locations | |
[DEBUG ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available. | |
[DEBUG ] Trying to execute 'ec2.list_nodes' with the following kwargs: {} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] LazyLoaded cloud.cache_node_list | |
[DEBUG ] LazyLoaded pprint.output | |
{'AWS-brawl-sandbox01': {'ec2': {'Controller2': {'id': 'i-086341be85c92a067', | |
'image': 'ami-ae7bfdb8', | |
'name': 'Controller2', | |
'private_ips': '10.90.14.141', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'cmd-vm': {'id': 'i-01dab8de377758b51', | |
'image': 'ami-ae7bfdb8', | |
'name': 'cmd-vm', | |
'private_ips': '10.90.14.29', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'controller': {'id': 'i-099950754fb58164f', | |
'image': 'ami-ae7bfdb8', | |
'name': 'controller', | |
'private_ips': '10.90.14.181', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'controller-new': {'id': 'i-05a3f2b85bf6cd4f1', | |
'image': 'ami-ae7bfdb8', | |
'name': 'controller-new', | |
'private_ips': '10.90.14.121', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'controller4': {'id': 'i-085680800ba0896b9', | |
'image': 'ami-ae7bfdb8', | |
'name': 'controller4', | |
'private_ips': '10.90.14.92', | |
'public_ips': '54.226.129.76', | |
'size': 't2.micro', | |
'state': 'running'}, | |
'test-vm': {'id': 'i-0c473878c1c6b8753', | |
'image': 'ami-ae7bfdb8', | |
'name': 'test-vm', | |
'private_ips': '10.90.14.171', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'running'}}}} | |
[root@controller4 ~]# salt-cloud -p AWS-brawl-sandbox01-analysis-linux-tiny pysalt-test-vm -l debug | |
[DEBUG ] Reading configuration from /etc/salt/cloud | |
[DEBUG ] Including configuration from '/etc/salt/cloud.conf.d/cloud.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.conf.d/cloud.conf | |
[DEBUG ] Reading configuration from /etc/salt/master | |
[DEBUG ] Including configuration from '/etc/salt/master.d/master.conf' | |
[DEBUG ] Reading configuration from /etc/salt/master.d/master.conf | |
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: ip-10-90-14-92 | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers | |
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/aws-provider.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/aws-provider.conf | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-analysis.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-analysis.conf | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-gameboard.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-gameboard.conf | |
[DEBUG ] Configuration file path: /etc/salt/cloud | |
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged. | |
[INFO ] salt-cloud starting | |
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False | |
[DEBUG ] LazyLoaded parallels.avail_locations | |
[DEBUG ] LazyLoaded proxmox.avail_sizes | |
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available. | |
[DEBUG ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available. | |
[DEBUG ] LazyLoaded openstack.list_locations | |
[DEBUG ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available. | |
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False | |
[DEBUG ] LazyLoaded parallels.avail_locations | |
[DEBUG ] LazyLoaded proxmox.avail_sizes | |
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available. | |
[DEBUG ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available. | |
[DEBUG ] LazyLoaded openstack.list_locations | |
[DEBUG ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available. | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] LazyLoaded cloud.cache_node_list | |
[DEBUG ] Generating minion keys for 'pysalt-test-vm' | |
[DEBUG ] LazyLoaded cloud.fire_event | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/pysalt-test-vm/creating; data = {'profile': 'AWS-brawl-sandbox01-analysis-linux-tiny', 'event': 'starting create', '_stamp': '2017-10-06T13:39:00.167189', 'name': 'pysalt-test-vm', 'provider': 'AWS-brawl-sandbox01:ec2'} | |
[INFO ] Creating Cloud VM pysalt-test-vm in us-east-1 | |
[DEBUG ] Create network interface: {'SubnetId': 'subnet-16b1a35e', 'DeviceIndex': 0, 'SecurityGroupId': 'sg-a3bee9d3', 'PrivateIpAddresses': [{'Primary': True}]} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeSubnets&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=CreateNetworkInterface&PrivateIpAddresses.0.Primary=true&SecurityGroupId=sg-a3bee9d3&SubnetId=subnet-16b1a35e&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Created network interface eni-eab28854 inst 0 | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/pysalt-test-vm/requesting; data = {'event': 'requesting instance', '_stamp': '2017-10-06T13:39:01.203372', 'location': 'us-east-1', 'kwargs': {'NetworkInterface.0.DeviceIndex': 0, 'ImageId': 'ami-ae7bfdb8', 'KeyName': 'BRAWL-Team_Sandbox1', 'MaxCount': 1, 'Action': 'RunInstances', 'MinCount': 1, 'NetworkInterface.0.NetworkInterfaceId': 'eni-eab28854', 'InstanceType': 't2.micro'}} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=RunInstances&ImageId=ami-ae7bfdb8&InstanceType=t2.micro&KeyName=BRAWL-Team_Sandbox1&MaxCount=1&MinCount=1&NetworkInterface.0.DeviceIndex=0&NetworkInterface.0.NetworkInterfaceId=eni-eab28854&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/pysalt-test-vm/querying; data = {'instance_id': 'i-04dad99c8aacc7e0e', '_stamp': '2017-10-06T13:39:02.613349', 'event': 'querying instance'} | |
[DEBUG ] The new VM instance_id is i-04dad99c8aacc7e0e | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&InstanceId.1=i-04dad99c8aacc7e0e&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] The query returned: [{'ownerId': '677998037804', 'groupSet': None, 'reservationId': 'r-07a8c847f7ab9a49e', 'instancesSet': {'item': {'productCodes': None, 'vpcId': 'vpc-9dac9de4', 'instanceId': 'i-04dad99c8aacc7e0e', 'imageId': 'ami-ae7bfdb8', 'keyName': 'BRAWL-Team_Sandbox1', 'clientToken': None, 'subnetId': 'subnet-16b1a35e', 'amiLaunchIndex': '0', 'instanceType': 't2.micro', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'monitoring': {'state': 'disabled'}, 'dnsName': None, 'privateIpAddress': '10.90.14.125', 'virtualizationType': 'hvm', 'privateDnsName': 'ip-10-90-14-125.ec2.internal', 'reason': None, 'sourceDestCheck': 'true', 'blockDeviceMapping': {'item': {'deviceName': '/dev/sda1', 'ebs': {'status': 'attaching', 'deleteOnTermination': 'false', 'volumeId': 'vol-0248f1ef5fa93ca88', 'attachTime': '2017-10-06T13:39:03.000Z'}}}, 'placement': {'groupName': None, 'tenancy': 'default', 'availabilityZone': 'us-east-1a'}, 'instanceState': {'code': '0', 'name': 'pending'}, 'networkInterfaceSet': {'item': {'status': 'in-use', 'macAddress': '0a:e3:09:17:7a:4a', 'sourceDestCheck': 'true', 'vpcId': 'vpc-9dac9de4', 'description': None, 'networkInterfaceId': 'eni-eab28854', 'privateDnsName': 'ip-10-90-14-125.ec2.internal', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'attachment': {'status': 'attaching', 'deviceIndex': '0', 'deleteOnTermination': 'false', 'attachmentId': 'eni-attach-3b631ec8', 'attachTime': '2017-10-06T13:39:02.000Z'}, 'subnetId': 'subnet-16b1a35e', 'ownerId': '677998037804', 'privateIpAddressesSet': {'item': {'privateDnsName': 'ip-10-90-14-125.ec2.internal', 'primary': 'true', 'privateIpAddress': '10.90.14.125'}}, 'privateIpAddress': '10.90.14.125'}}, 'ebsOptimized': 'false', 'launchTime': '2017-10-06T13:39:02.000Z', 'architecture': 'x86_64', 'hypervisor': 'xen', 'rootDeviceType': 'ebs', 'rootDeviceName': '/dev/sda1'}}}] | |
[DEBUG ] Waiting for VM IP. Giving up in 00:10:00. | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&InstanceId.1=i-04dad99c8aacc7e0e&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Returned query data: [{'ownerId': '677998037804', 'groupSet': None, 'reservationId': 'r-07a8c847f7ab9a49e', 'instancesSet': {'item': {'productCodes': None, 'vpcId': 'vpc-9dac9de4', 'instanceId': 'i-04dad99c8aacc7e0e', 'imageId': 'ami-ae7bfdb8', 'keyName': 'BRAWL-Team_Sandbox1', 'clientToken': None, 'subnetId': 'subnet-16b1a35e', 'amiLaunchIndex': '0', 'instanceType': 't2.micro', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'monitoring': {'state': 'disabled'}, 'dnsName': None, 'privateIpAddress': '10.90.14.125', 'virtualizationType': 'hvm', 'privateDnsName': 'ip-10-90-14-125.ec2.internal', 'reason': None, 'sourceDestCheck': 'true', 'blockDeviceMapping': {'item': {'deviceName': '/dev/sda1', 'ebs': {'status': 'attaching', 'deleteOnTermination': 'false', 'volumeId': 'vol-0248f1ef5fa93ca88', 'attachTime': '2017-10-06T13:39:03.000Z'}}}, 'placement': {'groupName': None, 'tenancy': 'default', 'availabilityZone': 'us-east-1a'}, 'instanceState': {'code': '0', 'name': 'pending'}, 'networkInterfaceSet': {'item': {'status': 'in-use', 'macAddress': '0a:e3:09:17:7a:4a', 'sourceDestCheck': 'true', 'vpcId': 'vpc-9dac9de4', 'description': None, 'networkInterfaceId': 'eni-eab28854', 'privateDnsName': 'ip-10-90-14-125.ec2.internal', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'attachment': {'status': 'attaching', 'deviceIndex': '0', 'deleteOnTermination': 'false', 'attachmentId': 'eni-attach-3b631ec8', 'attachTime': '2017-10-06T13:39:02.000Z'}, 'subnetId': 'subnet-16b1a35e', 'ownerId': '677998037804', 'privateIpAddressesSet': {'item': {'privateDnsName': 'ip-10-90-14-125.ec2.internal', 'primary': 'true', 'privateIpAddress': '10.90.14.125'}}, 'privateIpAddress': '10.90.14.125'}}, 'ebsOptimized': 'false', 'launchTime': '2017-10-06T13:39:02.000Z', 'architecture': 'x86_64', 'hypervisor': 'xen', 'rootDeviceType': 'ebs', 'rootDeviceName': '/dev/sda1'}}}] | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/pysalt-test-vm/tagging; data = {'_stamp': '2017-10-06T13:39:03.616729', 'event': 'setting tags', 'tags': {'Name': 'pysalt-test-vm'}} | |
[DEBUG ] Attempting function <function set_tags at 0x2020488> | |
[DEBUG ] Tags to set for pysalt-test-vm: {'Name': 'pysalt-test-vm'} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=CreateTags&ResourceId.1=i-04dad99c8aacc7e0e&Tag.0.Key=Name&Tag.0.Value=pysalt-test-vm&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeTags&Filter.1.Name=resource-id&Filter.1.Value=i-04dad99c8aacc7e0e&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Setting the tags returned: [{'resourceType': 'instance', 'resourceId': 'i-04dad99c8aacc7e0e', 'value': 'pysalt-test-vm', 'key': 'Name'}] | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=ModifyNetworkInterfaceAttribute&Attachment.AttachmentId=eni-attach-3b631ec8&Attachment.DeleteOnTermination=True&NetworkInterfaceId=eni-eab28854&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[INFO ] Created node pysalt-test-vm | |
[INFO ] Salt node data. Private_ip: 10.90.14.125 | |
[INFO ] Salt interface set to: 10.90.14.125 | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/pysalt-test-vm/waiting_for_ssh; data = {'_stamp': '2017-10-06T13:39:05.157607', 'ip_address': '10.90.14.125', 'event': 'waiting for ssh'} | |
[DEBUG ] Attempting connection to host 10.90.14.125 on port 445 | |
[DEBUG ] Caught exception in wait_for_port: timed out | |
[DEBUG ] Retrying connection to host 10.90.14.125 on port 445 (try 1) | |
^C | |
Exiting gracefully on Ctrl-c | |
[root@controller4 ~]# python3 | |
Python 3.5.3 (default, Oct 5 2017, 15:49:09) | |
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import salt.cloud | |
>>> c = salt.cloud.CloudClient(path='/etc/salt/cloud') | |
>>> c.profile('AWS-brawl-sandbox01-analysis-linux-tiny', names=['test-python']) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/usr/local/lib/python3.5/site-packages/salt/cloud/__init__.py", line 352, in profile | |
mapper.run_profile(profile, names, vm_overrides=vm_overrides) | |
File "/usr/local/lib/python3.5/site-packages/salt/cloud/__init__.py", line 1461, in run_profile | |
ret[name] = self.create(vm_) | |
File "/usr/local/lib/python3.5/site-packages/salt/cloud/__init__.py", line 1291, in create | |
output = self.clouds[func](vm_) | |
File "/usr/local/lib/python3.5/site-packages/salt/cloud/clouds/ec2.py", line 2444, in create | |
key_filename | |
salt.exceptions.SaltCloudSystemExit: The EC2 key file '/root/BRAWL-Team_Sandbox1' needs to be set to mode 0400 or 0600. | |
>>> | |
[root@controller4 ~]# chmod 0400 /root/BRAWL-Team_Sandbox1 | |
[root@controller4 ~]# python3 | |
Python 3.5.3 (default, Oct 5 2017, 15:49:09) | |
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import salt.cloud | |
>>> c = salt.cloud.CloudClient(path='/etc/salt/cloud') | |
>>> c.profile('AWS-brawl-sandbox01-analysis-linux-tiny', names=['test']) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/usr/local/lib/python3.5/site-packages/salt/cloud/__init__.py", line 352, in profile | |
mapper.run_profile(profile, names, vm_overrides=vm_overrides) | |
File "/usr/local/lib/python3.5/site-packages/salt/cloud/__init__.py", line 1461, in run_profile | |
ret[name] = self.create(vm_) | |
File "/usr/local/lib/python3.5/site-packages/salt/cloud/__init__.py", line 1291, in create | |
output = self.clouds[func](vm_) | |
File "/usr/local/lib/python3.5/site-packages/salt/cloud/clouds/ec2.py", line 2444, in create | |
key_filename | |
salt.exceptions.SaltCloudSystemExit: The EC2 key file '/root/BRAWL-Team_Sandbox1' needs to be set to mode 0400 or 0600. | |
>>> | |
[root@controller4 ~]# salt-cloud -f list_nodes AWS-brawl-sandbox01 --out=pprint -l debug | |
[DEBUG ] Reading configuration from /etc/salt/cloud | |
[DEBUG ] Including configuration from '/etc/salt/cloud.conf.d/cloud.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.conf.d/cloud.conf | |
[DEBUG ] Reading configuration from /etc/salt/master | |
[DEBUG ] Including configuration from '/etc/salt/master.d/master.conf' | |
[DEBUG ] Reading configuration from /etc/salt/master.d/master.conf | |
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: ip-10-90-14-92 | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers | |
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/aws-provider.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/aws-provider.conf | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-analysis.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-analysis.conf | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-gameboard.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-gameboard.conf | |
[DEBUG ] Configuration file path: /etc/salt/cloud | |
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged. | |
[INFO ] salt-cloud starting | |
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False | |
[DEBUG ] LazyLoaded parallels.avail_locations | |
[DEBUG ] LazyLoaded proxmox.avail_sizes | |
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available. | |
[DEBUG ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available. | |
[DEBUG ] LazyLoaded openstack.list_locations | |
[DEBUG ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available. | |
[DEBUG ] Trying to execute 'ec2.list_nodes' with the following kwargs: {} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] LazyLoaded cloud.cache_node_list | |
[DEBUG ] LazyLoaded pprint.output | |
{'AWS-brawl-sandbox01': {'ec2': {'Controller2': {'id': 'i-086341be85c92a067', | |
'image': 'ami-ae7bfdb8', | |
'name': 'Controller2', | |
'private_ips': '10.90.14.141', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'cmd-vm': {'id': 'i-01dab8de377758b51', | |
'image': 'ami-ae7bfdb8', | |
'name': 'cmd-vm', | |
'private_ips': '10.90.14.29', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'controller': {'id': 'i-099950754fb58164f', | |
'image': 'ami-ae7bfdb8', | |
'name': 'controller', | |
'private_ips': '10.90.14.181', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'controller-new': {'id': 'i-05a3f2b85bf6cd4f1', | |
'image': 'ami-ae7bfdb8', | |
'name': 'controller-new', | |
'private_ips': '10.90.14.121', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'stopped'}, | |
'controller4': {'id': 'i-085680800ba0896b9', | |
'image': 'ami-ae7bfdb8', | |
'name': 'controller4', | |
'private_ips': '10.90.14.92', | |
'public_ips': '54.226.129.76', | |
'size': 't2.micro', | |
'state': 'running'}, | |
'pysalt-test-vm': {'id': 'i-04dad99c8aacc7e0e', | |
'image': 'ami-ae7bfdb8', | |
'name': 'pysalt-test-vm', | |
'private_ips': '10.90.14.125', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'running'}, | |
'test-vm': {'id': 'i-0c473878c1c6b8753', | |
'image': 'ami-ae7bfdb8', | |
'name': 'test-vm', | |
'private_ips': '10.90.14.171', | |
'public_ips': [], | |
'size': 't2.micro', | |
'state': 'running'}}}} | |
[root@controller4 ~]# salt-cloud -p AWS-brawl-sandbox01-analysis-linux-tiny test-vm2 -l debug | |
[DEBUG ] Reading configuration from /etc/salt/cloud | |
[DEBUG ] Including configuration from '/etc/salt/cloud.conf.d/cloud.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.conf.d/cloud.conf | |
[DEBUG ] Reading configuration from /etc/salt/master | |
[DEBUG ] Including configuration from '/etc/salt/master.d/master.conf' | |
[DEBUG ] Reading configuration from /etc/salt/master.d/master.conf | |
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: ip-10-90-14-92 | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers | |
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/aws-provider.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/aws-provider.conf | |
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-analysis.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-analysis.conf | |
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/aws-profile-gameboard.conf' | |
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/aws-profile-gameboard.conf | |
[DEBUG ] Configuration file path: /etc/salt/cloud | |
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged. | |
[INFO ] salt-cloud starting | |
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False | |
[DEBUG ] LazyLoaded parallels.avail_locations | |
[DEBUG ] LazyLoaded proxmox.avail_sizes | |
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available. | |
[DEBUG ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available. | |
[DEBUG ] LazyLoaded openstack.list_locations | |
[DEBUG ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available. | |
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False | |
[DEBUG ] LazyLoaded parallels.avail_locations | |
[DEBUG ] LazyLoaded proxmox.avail_sizes | |
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available. | |
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available. | |
[DEBUG ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available. | |
[DEBUG ] LazyLoaded openstack.list_locations | |
[DEBUG ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available. | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] LazyLoaded cloud.cache_node_list | |
[DEBUG ] Generating minion keys for 'test-vm2' | |
[DEBUG ] LazyLoaded cloud.fire_event | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/test-vm2/creating; data = {'profile': 'AWS-brawl-sandbox01-analysis-linux-tiny', 'event': 'starting create', '_stamp': '2017-10-06T13:41:05.276278', 'name': 'test-vm2', 'provider': 'AWS-brawl-sandbox01:ec2'} | |
[INFO ] Creating Cloud VM test-vm2 in us-east-1 | |
[DEBUG ] Create network interface: {'SubnetId': 'subnet-16b1a35e', 'DeviceIndex': 0, 'SecurityGroupId': 'sg-a3bee9d3', 'PrivateIpAddresses': [{'Primary': True}]} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeSubnets&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=CreateNetworkInterface&PrivateIpAddresses.0.Primary=true&SecurityGroupId=sg-a3bee9d3&SubnetId=subnet-16b1a35e&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Created network interface eni-58bc86e6 inst 0 | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/test-vm2/requesting; data = {'event': 'requesting instance', '_stamp': '2017-10-06T13:41:06.138681', 'location': 'us-east-1', 'kwargs': {'NetworkInterface.0.DeviceIndex': 0, 'ImageId': 'ami-ae7bfdb8', 'KeyName': 'BRAWL-Team_Sandbox1', 'MaxCount': 1, 'Action': 'RunInstances', 'MinCount': 1, 'NetworkInterface.0.NetworkInterfaceId': 'eni-58bc86e6', 'InstanceType': 't2.micro'}} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=RunInstances&ImageId=ami-ae7bfdb8&InstanceType=t2.micro&KeyName=BRAWL-Team_Sandbox1&MaxCount=1&MinCount=1&NetworkInterface.0.DeviceIndex=0&NetworkInterface.0.NetworkInterfaceId=eni-58bc86e6&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/test-vm2/querying; data = {'instance_id': 'i-0a5918a96f89e57b2', '_stamp': '2017-10-06T13:41:07.367891', 'event': 'querying instance'} | |
[DEBUG ] The new VM instance_id is i-0a5918a96f89e57b2 | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&InstanceId.1=i-0a5918a96f89e57b2&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] The query returned: [{'ownerId': '677998037804', 'groupSet': None, 'reservationId': 'r-0ddcbed42c0345445', 'instancesSet': {'item': {'productCodes': None, 'vpcId': 'vpc-9dac9de4', 'instanceId': 'i-0a5918a96f89e57b2', 'imageId': 'ami-ae7bfdb8', 'keyName': 'BRAWL-Team_Sandbox1', 'clientToken': None, 'subnetId': 'subnet-16b1a35e', 'amiLaunchIndex': '0', 'instanceType': 't2.micro', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'monitoring': {'state': 'disabled'}, 'dnsName': None, 'privateIpAddress': '10.90.14.45', 'virtualizationType': 'hvm', 'privateDnsName': 'ip-10-90-14-45.ec2.internal', 'reason': None, 'sourceDestCheck': 'true', 'blockDeviceMapping': None, 'placement': {'groupName': None, 'tenancy': 'default', 'availabilityZone': 'us-east-1a'}, 'instanceState': {'code': '0', 'name': 'pending'}, 'networkInterfaceSet': {'item': {'status': 'in-use', 'macAddress': '0a:34:f6:71:81:08', 'sourceDestCheck': 'true', 'vpcId': 'vpc-9dac9de4', 'description': None, 'networkInterfaceId': 'eni-58bc86e6', 'privateDnsName': 'ip-10-90-14-45.ec2.internal', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'attachment': {'status': 'attaching', 'deviceIndex': '0', 'deleteOnTermination': 'false', 'attachmentId': 'eni-attach-b4592447', 'attachTime': '2017-10-06T13:41:07.000Z'}, 'subnetId': 'subnet-16b1a35e', 'ownerId': '677998037804', 'privateIpAddressesSet': {'item': {'privateDnsName': 'ip-10-90-14-45.ec2.internal', 'primary': 'true', 'privateIpAddress': '10.90.14.45'}}, 'privateIpAddress': '10.90.14.45'}}, 'ebsOptimized': 'false', 'launchTime': '2017-10-06T13:41:07.000Z', 'architecture': 'x86_64', 'hypervisor': 'xen', 'rootDeviceType': 'ebs', 'rootDeviceName': '/dev/sda1'}}}] | |
[DEBUG ] Waiting for VM IP. Giving up in 00:10:00. | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&InstanceId.1=i-0a5918a96f89e57b2&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Returned query data: [{'ownerId': '677998037804', 'groupSet': None, 'reservationId': 'r-0ddcbed42c0345445', 'instancesSet': {'item': {'productCodes': None, 'vpcId': 'vpc-9dac9de4', 'instanceId': 'i-0a5918a96f89e57b2', 'imageId': 'ami-ae7bfdb8', 'keyName': 'BRAWL-Team_Sandbox1', 'clientToken': None, 'subnetId': 'subnet-16b1a35e', 'amiLaunchIndex': '0', 'instanceType': 't2.micro', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'monitoring': {'state': 'disabled'}, 'dnsName': None, 'privateIpAddress': '10.90.14.45', 'virtualizationType': 'hvm', 'privateDnsName': 'ip-10-90-14-45.ec2.internal', 'reason': None, 'sourceDestCheck': 'true', 'blockDeviceMapping': {'item': {'deviceName': '/dev/sda1', 'ebs': {'status': 'attaching', 'deleteOnTermination': 'false', 'volumeId': 'vol-0371f299070149362', 'attachTime': '2017-10-06T13:41:07.000Z'}}}, 'placement': {'groupName': None, 'tenancy': 'default', 'availabilityZone': 'us-east-1a'}, 'instanceState': {'code': '0', 'name': 'pending'}, 'networkInterfaceSet': {'item': {'status': 'in-use', 'macAddress': '0a:34:f6:71:81:08', 'sourceDestCheck': 'true', 'vpcId': 'vpc-9dac9de4', 'description': None, 'networkInterfaceId': 'eni-58bc86e6', 'privateDnsName': 'ip-10-90-14-45.ec2.internal', 'groupSet': {'item': {'groupName': 'InfosecBaselineLinux', 'groupId': 'sg-a3bee9d3'}}, 'attachment': {'status': 'attaching', 'deviceIndex': '0', 'deleteOnTermination': 'false', 'attachmentId': 'eni-attach-b4592447', 'attachTime': '2017-10-06T13:41:07.000Z'}, 'subnetId': 'subnet-16b1a35e', 'ownerId': '677998037804', 'privateIpAddressesSet': {'item': {'privateDnsName': 'ip-10-90-14-45.ec2.internal', 'primary': 'true', 'privateIpAddress': '10.90.14.45'}}, 'privateIpAddress': '10.90.14.45'}}, 'ebsOptimized': 'false', 'launchTime': '2017-10-06T13:41:07.000Z', 'architecture': 'x86_64', 'hypervisor': 'xen', 'rootDeviceType': 'ebs', 'rootDeviceName': '/dev/sda1'}}}] | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/test-vm2/tagging; data = {'_stamp': '2017-10-06T13:41:08.388443', 'event': 'setting tags', 'tags': {'Name': 'test-vm2'}} | |
[DEBUG ] Attempting function <function set_tags at 0x2db7488> | |
[DEBUG ] Tags to set for test-vm2: {'Name': 'test-vm2'} | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=CreateTags&ResourceId.1=i-0a5918a96f89e57b2&Tag.0.Key=Name&Tag.0.Value=test-vm2&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeTags&Filter.1.Name=resource-id&Filter.1.Value=i-0a5918a96f89e57b2&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[DEBUG ] Setting the tags returned: [{'resourceType': 'instance', 'resourceId': 'i-0a5918a96f89e57b2', 'value': 'test-vm2', 'key': 'Name'}] | |
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com | |
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=ModifyNetworkInterfaceAttribute&Attachment.AttachmentId=eni-attach-b4592447&Attachment.DeleteOnTermination=True&NetworkInterfaceId=eni-58bc86e6&Version=2014-10-01 | |
[DEBUG ] AWS Response Status Code: 200 | |
[INFO ] Created node test-vm2 | |
[INFO ] Salt node data. Private_ip: 10.90.14.45 | |
[INFO ] Salt interface set to: 10.90.14.45 | |
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] Sending event: tag = salt/cloud/test-vm2/waiting_for_ssh; data = {'_stamp': '2017-10-06T13:41:09.932482', 'ip_address': '10.90.14.45', 'event': 'waiting for ssh'} | |
[DEBUG ] Attempting connection to host 10.90.14.45 on port 445 | |
[DEBUG ] Caught exception in wait_for_port: timed out | |
[DEBUG ] Retrying connection to host 10.90.14.45 on port 445 (try 1) | |
[DEBUG ] Caught exception in wait_for_port: timed out | |
[DEBUG ] Retrying connection to host 10.90.14.45 on port 445 (try 2) | |
^C | |
Exiting gracefully on Ctrl-c | |
[root@controller4 ~]# | |
[root@controller4 ~]# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment