wazuh / wazuh-qa

Wazuh - Quality Assurance
GNU General Public License v2.0
61 stars 30 forks source link

DTT1 - Allocation bug - Instance connection error #5198

Closed rauldpm closed 1 month ago

rauldpm commented 1 month ago

Description

Testing the DTT1 branch, we encountered an undesired behavior while running the following input YAML

YAML input ``` version: 0.1 description: This workflow is used to test agents' deployment for DDT1 PoC variables: agent-os: - linux-opensuse-15-amd64 manager-os: linux-ubuntu-22.04-amd64 infra-provider: aws working-dir: /tmp/dtt1-poc tasks: # Unique manager allocate task - task: "allocate-manager-{manager-os}" description: "Allocate resources for the manager." do: this: process with: path: python3 args: - modules/allocation/main.py - action: create - provider: "{infra-provider}" - size: large - composite-name: "{manager-os}" - inventory-output: "{working-dir}/manager-{manager-os}/inventory.yaml" - track-output: "{working-dir}/manager-{manager-os}/track.yaml" - label-termination-date: "1d" - label-team: "qa" # Unique agent allocate task - task: "allocate-agent-{agent}" description: "Allocate resources for the agent." do: this: process with: path: python3 args: - modules/allocation/main.py - action: create - provider: "{infra-provider}" - size: small - composite-name: "{agent}" - inventory-output: "{working-dir}/agent-{agent}/inventory.yaml" - track-output: "{working-dir}/agent-{agent}/track.yaml" - label-termination-date: "1d" - label-team: "qa" foreach: - variable: agent-os as: agent cleanup: this: process with: path: python3 args: - modules/allocation/main.py - action: delete - track-output: "{working-dir}/agent-{agent}/track.yaml" depends-on: - "provision-manager-{manager-os}" # Unique manager provision task - task: "provision-manager-{manager-os}" description: "Provision the manager." do: this: process with: path: python3 args: - modules/provision/main.py - inventory: "{working-dir}/manager-{manager-os}/inventory.yaml" - install: - component: wazuh-manager type: assistant version: 4.7.3 live: True depends-on: - "allocate-manager-{manager-os}" # Generic agent provision task - task: "provision-install-{agent}" description: "Provision resources for the {agent} agent." do: this: process with: path: python3 args: - modules/provision/main.py - inventory: "{working-dir}/agent-{agent}/inventory.yaml" - dependencies: - manager: "{working-dir}/manager-{manager-os}/inventory.yaml" - install: - component: curl depends-on: - "allocate-agent-{agent}" - "provision-manager-{manager-os}" foreach: - variable: agent-os as: agent # Generic agent test task - task: "run-agent-{agent}-tests" description: "Run tests install for the agent {agent}." do: this: process with: path: python3 args: - modules/testing/main.py - targets: - wazuh-1: "{working-dir}/manager-{manager-os}/inventory.yaml" - agent: "{working-dir}/agent-{agent}/inventory.yaml" - tests: "install,registration,restart,stop,uninstall" - component: "agent" - wazuh-version: "4.7.3" - wazuh-revision: "40714" - live: "True" foreach: - variable: agent-os as: agent depends-on: - "allocate-agent-{agent}" ```

Apparently, the provision module is not able to connect to the raised instance, by introducing a 5-minute sleep in the run method of provision.py, the connection has been made successfully, the Allocation module must guarantee usability and connectivity of created resources

╰─➤  python3 -m workflow_engine modules/workflow_engine/examples/test/aws/test-agent-suse.yaml --log-level DEBUG
[2024-04-09 23:50:12] [DEBUG] [55446] [MainThread] [workflow_engine]: Validating input file: modules/workflow_engine/examples/test/aws/test-agent-suse.yaml
[2024-04-09 23:50:12] [DEBUG] [55446] [MainThread] [workflow_engine]: Loading schema file: /home/xxxx/Documents/Wazuh/Repositories/wazuh-qa/wazuh-qa/deployability/env/lib/python3.10/site-packages/workflow_engine/schemas/schema_v1.json
[2024-04-09 23:50:12] [DEBUG] [55446] [MainThread] [workflow_engine]: Loading yaml file: modules/workflow_engine/examples/test/aws/test-agent-suse.yaml
[2024-04-09 23:50:12] [DEBUG] [55446] [MainThread] [workflow_engine]: Loading workflow file: modules/workflow_engine/examples/test/aws/test-agent-suse.yaml
[2024-04-09 23:50:12] [DEBUG] [55446] [MainThread] [workflow_engine]: Process workflow.
[2024-04-09 23:50:12] [INFO] [55446] [MainThread] [workflow_engine]: Executing DAG tasks.
[2024-04-09 23:50:12] [INFO] [55446] [MainThread] [workflow_engine]: Executing tasks in parallel.
[2024-04-09 23:50:12] [INFO] [55446] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-manager-linux-ubuntu-22.04-amd64] Starting task.
[2024-04-09 23:50:12] [DEBUG] [55446] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "allocate-manager-linux-ubuntu-22.04-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=large', '--composite-name=linux-ubuntu-22.04-amd64', '--inventory-output=/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa']
[2024-04-09 23:50:33] [DEBUG] [55446] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "allocate-manager-linux-ubuntu-22.04-amd64" execution with result:
[2024-04-09 23:50:12] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-09 23:50:13] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-09 23:50:13] [DEBUG] ALLOCATOR: Generating new key pair
[2024-04-09 23:50:13] [DEBUG] ALLOCATOR: Creating base directory: /tmp/wazuh-qa/AWS-0E837C7B-79F7-4B38-9531-FCD6AD81C7BE
[2024-04-09 23:50:31] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-0E837C7B-79F7-4B38-9531-FCD6AD81C7BE directory to /tmp/wazuh-qa/i-008687fda84da5b51
[2024-04-09 23:50:31] [INFO] ALLOCATOR: Instance i-008687fda84da5b51 created.
[2024-04-09 23:50:33] [INFO] ALLOCATOR: Instance i-008687fda84da5b51 started.
[2024-04-09 23:50:33] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml
[2024-04-09 23:50:33] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/track.yaml

[2024-04-09 23:50:33] [INFO] [55446] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-manager-linux-ubuntu-22.04-amd64] Finished task in 20.59 seconds.
[2024-04-09 23:50:33] [INFO] [55446] [ThreadPoolExecutor-0_0] [workflow_engine]: [provision-manager-linux-ubuntu-22.04-amd64] Starting task.
[2024-04-09 23:50:33] [DEBUG] [55446] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "provision-manager-linux-ubuntu-22.04-amd64" with arguments: ['modules/provision/main.py', '--inventory=/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml', "--install={'component': 'wazuh-manager', 'type': 'assistant', 'version': '4.7.3', 'live': True}"]
[2024-04-09 23:50:34] [DEBUG] [55446] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "provision-manager-linux-ubuntu-22.04-amd64" execution with result:
[2024-04-09 23:50:33] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-44-212-40-6.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-008687fda84da5b51/ubuntu-22.04-amd64-key-5335'}}}}
[2024-04-09 23:50:33] [DEBUG] ANSIBLE: Running playbook: {'hosts': 'ec2-44-212-40-6.compute-1.amazonaws.com', 'become': True, 'gather_facts': True, 'tasks': [{'name': 'Capture ansible_os_family', 'set_fact': {'ansible_os_family': "{{ ansible_facts['distribution_file_variety'] }}", 'cacheable': 'yes'}}]}
Using /etc/ansible/ansible.cfg as config file

PLAY [ec2-44-212-40-6.compute-1.amazonaws.com] *********************************

TASK [Gathering Facts] *********************************************************
fatal: [ec2-44-212-40-6.compute-1.amazonaws.com]: UNREACHABLE! => changed=false 
  msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-44-212-40-6.compute-1.amazonaws.com port 2200: Connection refused'
  unreachable: true

PLAY RECAP *********************************************************************
ec2-44-212-40-6.compute-1.amazonaws.com : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0 
c-bordon commented 1 month ago

Update report

Tests

Successfully connection:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --size large --ssh-key ~/.ssh/allocation_test --composite-name linux-ubuntu-22.04-amd64
[2024-04-11 10:50:12] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-11 10:50:12] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-11 10:50:12] [DEBUG] ALLOCATOR: Using provided key pair
[2024-04-11 10:50:15] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-04-11 10:50:15] [INFO] ALLOCATOR: Instance VAGRANT-30CF26B8-F8F0-4BD2-9A0C-2F1493B1949B created.
[2024-04-11 10:50:56] [INFO] ALLOCATOR: Instance VAGRANT-30CF26B8-F8F0-4BD2-9A0C-2F1493B1949B started.
[2024-04-11 10:50:59] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/VAGRANT-30CF26B8-F8F0-4BD2-9A0C-2F1493B1949B/inventory.yml
[2024-04-11 10:50:59] [INFO] ALLOCATOR: SSH connection successful.
[2024-04-11 10:51:02] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/VAGRANT-30CF26B8-F8F0-4BD2-9A0C-2F1493B1949B/track.yml

Successfully connection after first attempt:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size micro --ssh-key ~/.ssh/allocation_test --composite-name linux-ubuntu-22.04-amd64 --label-termination-date "1d" --label-team devops
[2024-04-11 10:52:45] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-11 10:52:46] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-11 10:52:46] [DEBUG] ALLOCATOR: Using provided key pair
[2024-04-11 10:52:47] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-7677CA0F-D39C-4979-8204-F6625177FA66
[2024-04-11 10:53:20] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-7677CA0F-D39C-4979-8204-F6625177FA66 directory to /tmp/wazuh-qa/i-0de9f0854cba80048
[2024-04-11 10:53:20] [INFO] ALLOCATOR: Instance i-0de9f0854cba80048 created.
[2024-04-11 10:53:21] [INFO] ALLOCATOR: Instance i-0de9f0854cba80048 started.
[2024-04-11 10:53:22] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-0de9f0854cba80048/inventory.yml
[2024-04-11 10:53:22] [WARNING] ALLOCATOR: Error on attempt 1 of 10: [Errno None] Unable to connect to port 2200 on 18.209.159.184
[2024-04-11 10:56:23] [INFO] ALLOCATOR: SSH connection successful.
[2024-04-11 10:56:23] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-0de9f0854cba80048/track.yml

Unsuccessfully connection after ten attempts:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size micro --ssh-key ~/.ssh/allocation_test --composite-name linux-ubuntu-22.04-amd64 --label-termination-date "1d" --label-team devops
[2024-04-11 11:30:12] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-11 11:30:12] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-11 11:30:12] [DEBUG] ALLOCATOR: Using provided key pair
[2024-04-11 11:30:13] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-49BACC0B-8BBB-4ABC-A65F-56F09F49B061
[2024-04-11 11:30:46] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-49BACC0B-8BBB-4ABC-A65F-56F09F49B061 directory to /tmp/wazuh-qa/i-0ac03b7e8887fde98
[2024-04-11 11:30:46] [INFO] ALLOCATOR: Instance i-0ac03b7e8887fde98 created.
[2024-04-11 11:30:48] [INFO] ALLOCATOR: Instance i-0ac03b7e8887fde98 started.
[2024-04-11 11:30:48] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-0ac03b7e8887fde98/inventory.yml
[2024-04-11 11:30:48] [WARNING] ALLOCATOR: Error on attempt 1 of 10: [Errno None] Unable to connect to port 2200 on 52.91.75.82
[2024-04-11 11:34:02] [WARNING] ALLOCATOR: Error on attempt 2 of 10: [Errno 110] Connection timed out
[2024-04-11 11:37:17] [WARNING] ALLOCATOR: Error on attempt 3 of 10: [Errno 110] Connection timed out
[2024-04-11 11:40:32] [WARNING] ALLOCATOR: Error on attempt 4 of 10: [Errno 110] Connection timed out
[2024-04-11 11:43:46] [WARNING] ALLOCATOR: Error on attempt 5 of 10: [Errno 110] Connection timed out
[2024-04-11 11:47:01] [WARNING] ALLOCATOR: Error on attempt 6 of 10: [Errno 110] Connection timed out
[2024-04-11 11:50:15] [WARNING] ALLOCATOR: Error on attempt 7 of 10: [Errno 110] Connection timed out
[2024-04-11 11:53:30] [WARNING] ALLOCATOR: Error on attempt 8 of 10: [Errno 110] Connection timed out
[2024-04-11 11:56:44] [WARNING] ALLOCATOR: Error on attempt 9 of 10: [Errno 110] Connection timed out
[2024-04-11 11:59:59] [WARNING] ALLOCATOR: Error on attempt 10 of 10: [Errno 110] Connection timed out
[2024-04-11 12:00:59] [ERROR] ALLOCATOR: Connection attempts failed after 10 tries. Connection timeout.
[2024-04-11 12:00:59] [WARNING] ALLOCATOR: The VM will not be automatically removed. Please remove it executing Allocation module with --action delete.
[2024-04-11 12:00:59] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-0ac03b7e8887fde98/track.yml
c-bordon commented 1 month ago

Update report

Windows with winrm test:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size micro --ssh-key ~/.ssh/allocation_test --composite-name windows-server-2022-amd64 --label-termination-date "1d" --label-team devops
[2024-04-11 15:46:00] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-11 15:46:01] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-11 15:46:01] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-480001C4-EB79-41F9-A1FC-AD9CD10C1B16
[2024-04-11 15:46:49] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-480001C4-EB79-41F9-A1FC-AD9CD10C1B16 directory to /tmp/wazuh-qa/i-00c9395ef9fb03d84
[2024-04-11 15:46:49] [INFO] ALLOCATOR: Instance i-00c9395ef9fb03d84 created.
[2024-04-11 15:46:51] [INFO] ALLOCATOR: Instance i-00c9395ef9fb03d84 started.
[2024-04-11 15:46:52] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-00c9395ef9fb03d84/inventory.yml
[2024-04-11 15:47:22] [WARNING] ALLOCATOR: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-54-80-85-111.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x76f8bdf25390>, 'Connection to ec2-54-80-85-111.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-11 15:48:24] [WARNING] ALLOCATOR: Error on attempt 2 of 10: the specified credentials were rejected by the server
[2024-04-11 15:49:26] [INFO] ALLOCATOR: WinRM connection successful.
[2024-04-11 15:49:26] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-00c9395ef9fb03d84/track.yml
c-bordon commented 1 month ago

Windows connection tests with rollback:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size micro --ssh-key ~/.ssh/allocation_test --composite-name windows-server-2022-amd64 --label-termination-date "1d" --label-team devops
[2024-04-11 16:22:52] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-11 16:22:52] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-11 16:22:52] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-C679525A-83E6-4CD5-AFB7-F0145F858E83
[2024-04-11 16:23:56] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-C679525A-83E6-4CD5-AFB7-F0145F858E83 directory to /tmp/wazuh-qa/i-05c5a28505b770adc
[2024-04-11 16:23:56] [INFO] ALLOCATOR: Instance i-05c5a28505b770adc created.
[2024-04-11 16:23:58] [INFO] ALLOCATOR: Instance i-05c5a28505b770adc started.
[2024-04-11 16:23:58] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-05c5a28505b770adc/inventory.yml
[2024-04-11 16:24:28] [WARNING] ALLOCATOR: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-3-94-81-114.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7205c545ca60>, 'Connection to ec2-3-94-81-114.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-11 16:25:40] [WARNING] ALLOCATOR: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-3-94-81-114.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:26:41] [WARNING] ALLOCATOR: Error on attempt 3 of 10: HTTPSConnectionPool(host='ec2-3-94-81-114.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:27:41] [WARNING] ALLOCATOR: Error on attempt 4 of 10: HTTPSConnectionPool(host='ec2-3-94-81-114.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:28:42] [WARNING] ALLOCATOR: Error on attempt 5 of 10: HTTPSConnectionPool(host='ec2-3-94-81-114.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:29:42] [WARNING] ALLOCATOR: Error on attempt 6 of 10: HTTPSConnectionPool(host='ec2-3-94-81-114.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:30:43] [WARNING] ALLOCATOR: Error on attempt 7 of 10: HTTPSConnectionPool(host='ec2-3-94-81-114.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:31:43] [WARNING] ALLOCATOR: Error on attempt 8 of 10: HTTPSConnectionPool(host='ec2-3-94-81-114.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:32:44] [WARNING] ALLOCATOR: Error on attempt 9 of 10: HTTPSConnectionPool(host='ec2-3-94-81-114.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:33:44] [WARNING] ALLOCATOR: Error on attempt 10 of 10: HTTPSConnectionPool(host='ec2-3-94-81-114.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:34:44] [ERROR] ALLOCATOR: Connection attempts failed after 10 tries. Connection timeout.
[2024-04-11 16:34:44] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-05c5a28505b770adc/track.yml
[2024-04-11 16:34:44] [WARNING] ALLOCATOR: Rolling back instance creation.
[2024-04-11 16:36:34] [INFO] ALLOCATOR: Instance i-05c5a28505b770adc deleted.
[2024-04-11 16:36:34] [INFO] ALLOCATOR: Instance i-05c5a28505b770adc deleted.
c-bordon commented 1 month ago

Windows connection test without rollback:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size micro --ssh-key ~/.ssh/allocation_test --composite-name windows-server-2022-amd64 --label-termination-date "1d" --label-team devops --rollback False
[2024-04-11 16:43:11] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-11 16:43:11] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-11 16:43:11] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-DC0CC3F2-5EE5-4E40-9570-AEFC5B858D7F
[2024-04-11 16:43:44] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-DC0CC3F2-5EE5-4E40-9570-AEFC5B858D7F directory to /tmp/wazuh-qa/i-0d7ae74c040524e2e
[2024-04-11 16:43:44] [INFO] ALLOCATOR: Instance i-0d7ae74c040524e2e created.
[2024-04-11 16:43:46] [INFO] ALLOCATOR: Instance i-0d7ae74c040524e2e started.
[2024-04-11 16:43:46] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-0d7ae74c040524e2e/inventory.yml
[2024-04-11 16:44:16] [WARNING] ALLOCATOR: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-3-81-117-188.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7d6f1438c910>, 'Connection to ec2-3-81-117-188.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-11 16:45:36] [WARNING] ALLOCATOR: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-3-81-117-188.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:46:37] [WARNING] ALLOCATOR: Error on attempt 3 of 10: HTTPSConnectionPool(host='ec2-3-81-117-188.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:47:37] [WARNING] ALLOCATOR: Error on attempt 4 of 10: HTTPSConnectionPool(host='ec2-3-81-117-188.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:48:38] [WARNING] ALLOCATOR: Error on attempt 5 of 10: HTTPSConnectionPool(host='ec2-3-81-117-188.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:49:38] [WARNING] ALLOCATOR: Error on attempt 6 of 10: HTTPSConnectionPool(host='ec2-3-81-117-188.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:50:39] [WARNING] ALLOCATOR: Error on attempt 7 of 10: HTTPSConnectionPool(host='ec2-3-81-117-188.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:51:39] [WARNING] ALLOCATOR: Error on attempt 8 of 10: HTTPSConnectionPool(host='ec2-3-81-117-188.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:52:40] [WARNING] ALLOCATOR: Error on attempt 9 of 10: HTTPSConnectionPool(host='ec2-3-81-117-188.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:53:40] [WARNING] ALLOCATOR: Error on attempt 10 of 10: HTTPSConnectionPool(host='ec2-3-81-117-188.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)')))
[2024-04-11 16:54:40] [ERROR] ALLOCATOR: Connection attempts failed after 10 tries. Connection timeout.
[2024-04-11 16:54:40] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-0d7ae74c040524e2e/track.yml
[2024-04-11 16:54:40] [WARNING] ALLOCATOR: The VM will not be automatically removed. Please remove it executing Allocation module with --action delete.
c-bordon commented 1 month ago

PPC test

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test --composite-name linux-debian-9-ppc64
[2024-04-12 10:04:11] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-12 10:04:17] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-12 10:04:17] [DEBUG] ALLOCATOR: Using provided key pair
[2024-04-12 10:04:23] [INFO] ALLOCATOR: Instance VAGRANT-49D25B0B-DA6B-4581-AC6C-0554D1AF6824 created.
[2024-04-12 10:04:37] [INFO] ALLOCATOR: Instance VAGRANT-49D25B0B-DA6B-4581-AC6C-0554D1AF6824 started.
[2024-04-12 10:04:37] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/VAGRANT-49D25B0B-DA6B-4581-AC6C-0554D1AF6824/inventory.yml
[2024-04-12 10:04:40] [INFO] ALLOCATOR: SSH connection successful.
[2024-04-12 10:04:40] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/VAGRANT-49D25B0B-DA6B-4581-AC6C-0554D1AF6824/track.ym
c-bordon commented 1 month ago

macOS Intel Vagrant

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test --composite-name macos-catalina-10.15.1-amd64
[2024-04-12 10:05:56] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-12 10:05:56] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-04-12 10:06:10] [INFO] ALLOCATOR: Using the black mini server to deploy.
[2024-04-12 10:06:14] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-12 10:06:14] [DEBUG] ALLOCATOR: Using provided key pair
[2024-04-12 10:06:21] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-04-12 10:06:26] [INFO] ALLOCATOR: Instance VAGRANT-99820A64-5D1D-4A9B-A4F2-2E1CF0E84621 created.
[2024-04-12 10:09:23] [ERROR] ALLOCATOR: Command failed: Sorry, don't know how to check guest version of Virtualbox Guest Additions on this platform. Stopping installation.

[2024-04-12 10:09:23] [INFO] ALLOCATOR: Instance VAGRANT-99820A64-5D1D-4A9B-A4F2-2E1CF0E84621 started.
[2024-04-12 10:09:34] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/VAGRANT-99820A64-5D1D-4A9B-A4F2-2E1CF0E84621/inventory.yml
[2024-04-12 10:09:36] [INFO] ALLOCATOR: SSH connection successful.
[2024-04-12 10:09:48] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/VAGRANT-99820A64-5D1D-4A9B-A4F2-2E1CF0E84621/track.yml
c-bordon commented 1 month ago

macOS ARM macStadium

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test --composite-name macos-ventura-13.4.1-arm64
[2024-04-12 10:11:18] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-12 10:11:18] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-04-12 10:11:23] [INFO] ALLOCATOR: macStadium server has less than 2 VMs running, deploying in this host.
[2024-04-12 10:11:26] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-12 10:11:26] [DEBUG] ALLOCATOR: Using provided key pair
[2024-04-12 10:11:29] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-04-12 10:11:33] [INFO] ALLOCATOR: Instance VAGRANT-4240F84D-44B5-4926-9559-760F3D421123 created.
[2024-04-12 10:12:24] [INFO] ALLOCATOR: Instance VAGRANT-4240F84D-44B5-4926-9559-760F3D421123 started.
[2024-04-12 10:12:42] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/VAGRANT-4240F84D-44B5-4926-9559-760F3D421123/inventory.yml
[2024-04-12 10:12:44] [INFO] ALLOCATOR: SSH connection successful.
[2024-04-12 10:12:55] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/VAGRANT-4240F84D-44B5-4926-9559-760F3D421123/track.yml
c-bordon commented 1 month ago

Bug in Administrator user creation in userData

in the tests I found a bug when we try to create the user Administrator in this amis: windows-server-2012r2-amd64, windows-desktop-11-amd64, windows-desktop-10-amd64.

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --label-termination-date "1d" --label-team devops --size micro --ssh-key ~/.ssh/allocation_test --composite-name windows-desktop-10-amd64
[2024-04-12 10:19:25] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-12 10:19:25] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-12 10:19:25] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-7DAC6CBB-0151-4D3B-B805-C179951BDF16
[2024-04-12 10:20:13] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-7DAC6CBB-0151-4D3B-B805-C179951BDF16 directory to /tmp/wazuh-qa/i-0257e4c465860249d
[2024-04-12 10:20:13] [INFO] ALLOCATOR: Instance i-0257e4c465860249d created.
[2024-04-12 10:20:15] [INFO] ALLOCATOR: Instance i-0257e4c465860249d started.
[2024-04-12 10:20:16] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-0257e4c465860249d/inventory.yml
[2024-04-12 10:20:46] [WARNING] ALLOCATOR: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-54-164-105-215.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x771409ac87c0>, 'Connection to ec2-54-164-105-215.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-12 10:22:06] [WARNING] ALLOCATOR: Error on attempt 2 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 10:23:07] [WARNING] ALLOCATOR: Error on attempt 3 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 10:24:07] [WARNING] ALLOCATOR: Error on attempt 4 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 10:25:07] [WARNING] ALLOCATOR: Error on attempt 5 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 10:26:08] [WARNING] ALLOCATOR: Error on attempt 6 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 10:27:08] [WARNING] ALLOCATOR: Error on attempt 7 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 10:28:09] [WARNING] ALLOCATOR: Error on attempt 8 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 10:29:09] [WARNING] ALLOCATOR: Error on attempt 9 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 10:30:10] [WARNING] ALLOCATOR: Error on attempt 10 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 10:31:10] [ERROR] ALLOCATOR: Connection attempts failed after 10 tries. Connection timeout.
[2024-04-12 10:31:10] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-0257e4c465860249d/track.yml
[2024-04-12 10:31:10] [WARNING] ALLOCATOR: Rolling back instance creation.
[2024-04-12 10:32:59] [INFO] ALLOCATOR: Instance i-0257e4c465860249d deleted.
[2024-04-12 10:32:59] [INFO] ALLOCATOR: Instance i-0257e4c465860249d deleted.

I'm doing additional testing on this amis to fix the userData script for Windows

c-bordon commented 1 month ago

Update report

The issue in the Windows server 2016 AMI was that the EC2 utility was not configured to execute user Data script on boot.

I had to create a new ami with this configuration and I was able to validate that the user data was executed correctly, although I encountered another error, possibly the Windows firewall is affecting our connectivity. I am doing new tests

cbordon@cbordon:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --label-team devops --label-termination-date "1d" --size large --composite-name windows-server-2016-amd64
[2024-04-12 16:44:38] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-12 16:44:38] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-12 16:44:39] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-133213B0-9852-4B02-B4F5-F12DCA8DE26E
[2024-04-12 16:44:57] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-133213B0-9852-4B02-B4F5-F12DCA8DE26E directory to /tmp/wazuh-qa/i-08858790fb7902ef4
[2024-04-12 16:44:57] [INFO] ALLOCATOR: Instance i-08858790fb7902ef4 created.
[2024-04-12 16:44:59] [INFO] ALLOCATOR: Instance i-08858790fb7902ef4 started.
[2024-04-12 16:44:59] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-08858790fb7902ef4/inventory.yml
[2024-04-12 16:45:30] [WARNING] ALLOCATOR: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-3-82-47-201.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x714ff94f04c0>, 'Connection to ec2-3-82-47-201.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-12 16:46:30] [WARNING] ALLOCATOR: Error on attempt 2 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 16:47:31] [WARNING] ALLOCATOR: Error on attempt 3 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 16:48:32] [WARNING] ALLOCATOR: Error on attempt 4 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 16:49:32] [WARNING] ALLOCATOR: Error on attempt 5 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 16:50:32] [WARNING] ALLOCATOR: Error on attempt 6 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 16:51:33] [WARNING] ALLOCATOR: Error on attempt 7 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-12 16:52:34] [WARNING] ALLOCATOR: Error on attempt 8 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
c-bordon commented 1 month ago

Windows server 2012 R2

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size large --label-team devops --label-termination-date "1d" --composite-name windows-server-2012r2-amd64[2024-04-15 14:23:23] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-15 14:23:24] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-15 14:23:24] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-058F0A09-6666-42B7-B0AC-C13F680DE878
[2024-04-15 14:23:41] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-058F0A09-6666-42B7-B0AC-C13F680DE878 directory to /tmp/wazuh-qa/i-08f7c6b9253b54803
[2024-04-15 14:23:41] [INFO] ALLOCATOR: Instance i-08f7c6b9253b54803 created.
[2024-04-15 14:23:43] [INFO] ALLOCATOR: Instance i-08f7c6b9253b54803 started.
[2024-04-15 14:23:43] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-08f7c6b9253b54803/inventory.yml
[2024-04-15 14:24:14] [WARNING] ALLOCATOR: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-35-168-14-137.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x762c925d04f0>, 'Connection to ec2-35-168-14-137.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-15 14:25:44] [WARNING] ALLOCATOR: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-35-168-14-137.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x762c925856f0>, 'Connection to ec2-35-168-14-137.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-15 14:26:44] [WARNING] ALLOCATOR: Error on attempt 3 of 10: HTTPSConnectionPool(host='ec2-35-168-14-137.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x762c9246a2f0>: Failed to establish a new connection: [Errno 111] Connection refused'))
[2024-04-15 14:27:44] [WARNING] ALLOCATOR: Error on attempt 4 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 14:29:04] [INFO] ALLOCATOR: WinRM connection successful.
[2024-04-15 14:29:04] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-08f7c6b9253b54803/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --action delete --track-output /tmp/wazuh-qa/i-08f7c6b9253b54803/track.yml
[2024-04-15 14:30:45] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/i-08f7c6b9253b54803/track.yml
[2024-04-15 14:31:47] [INFO] ALLOCATOR: Instance i-08f7c6b9253b54803 deleted.
c-bordon commented 1 month ago

Windows server 2016

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size large --label-team devops --label-termination-date "1d" --composite-name windows-server-2016-amd64
[2024-04-15 14:17:06] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-15 14:17:06] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-15 14:17:06] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-721F5C88-5926-40F1-97B1-FD22E28BA092
[2024-04-15 14:17:24] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-721F5C88-5926-40F1-97B1-FD22E28BA092 directory to /tmp/wazuh-qa/i-062eb6a27b0ad97f4
[2024-04-15 14:17:24] [INFO] ALLOCATOR: Instance i-062eb6a27b0ad97f4 created.
[2024-04-15 14:17:25] [INFO] ALLOCATOR: Instance i-062eb6a27b0ad97f4 started.
[2024-04-15 14:17:26] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-062eb6a27b0ad97f4/inventory.yml
[2024-04-15 14:17:56] [WARNING] ALLOCATOR: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-3-92-47-163.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7d768fb9c4f0>, 'Connection to ec2-3-92-47-163.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-15 14:19:00] [WARNING] ALLOCATOR: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-3-92-47-163.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7d768fb56110>: Failed to establish a new connection: [Errno 111] Connection refused'))
[2024-04-15 14:20:00] [WARNING] ALLOCATOR: Error on attempt 3 of 10: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 14:21:03] [INFO] ALLOCATOR: WinRM connection successful.
[2024-04-15 14:21:03] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-062eb6a27b0ad97f4/track.yml
c-bordon commented 1 month ago

Windows server 2019

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size large --label-team devops --label-termination-date "1d" --composite-name windows-server-2019-amd64[2024-04-15 14:32:44] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-15 14:32:44] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-15 14:32:44] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-A2638A83-03B8-4D92-BBDF-9BE39F40A6A6
[2024-04-15 14:33:02] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-A2638A83-03B8-4D92-BBDF-9BE39F40A6A6 directory to /tmp/wazuh-qa/i-0b09ef48457e698db
[2024-04-15 14:33:02] [INFO] ALLOCATOR: Instance i-0b09ef48457e698db created.
[2024-04-15 14:33:03] [INFO] ALLOCATOR: Instance i-0b09ef48457e698db started.
[2024-04-15 14:33:03] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-0b09ef48457e698db/inventory.yml
[2024-04-15 14:33:34] [WARNING] ALLOCATOR: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-35-153-210-166.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x77917c9a0be0>, 'Connection to ec2-35-153-210-166.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-15 14:35:04] [WARNING] ALLOCATOR: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-35-153-210-166.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x77917c9560e0>, 'Connection to ec2-35-153-210-166.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-15 14:36:06] [INFO] ALLOCATOR: WinRM connection successful.
[2024-04-15 14:36:06] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-0b09ef48457e698db/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --action delete --track-output /tmp/wazuh-qa/i-0b09ef48457e698db/track.yml
[2024-04-15 14:36:25] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/i-0b09ef48457e698db/track.yml
[2024-04-15 14:37:59] [INFO] ALLOCATOR: Instance i-0b09ef48457e698db deleted.
c-bordon commented 1 month ago

Windows server 2022

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size large --label-team devops --label-termination-date "1d" --composite-name windows-server-2022-amd64
[2024-04-15 14:38:19] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-15 14:38:19] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-15 14:38:19] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-A643198B-8F74-438D-BACE-815D998B484F
[2024-04-15 14:38:37] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-A643198B-8F74-438D-BACE-815D998B484F directory to /tmp/wazuh-qa/i-059b5c0a6843c4ae3
[2024-04-15 14:38:37] [INFO] ALLOCATOR: Instance i-059b5c0a6843c4ae3 created.
[2024-04-15 14:38:38] [INFO] ALLOCATOR: Instance i-059b5c0a6843c4ae3 started.
[2024-04-15 14:38:38] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-059b5c0a6843c4ae3/inventory.yml
[2024-04-15 14:39:08] [WARNING] ALLOCATOR: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-54-92-250-251.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x716d6e4f0880>, 'Connection to ec2-54-92-250-251.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-15 14:40:11] [INFO] ALLOCATOR: WinRM connection successful.
[2024-04-15 14:40:11] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-059b5c0a6843c4ae3/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --action delete --track-output /tmp/wazuh-qa/i-059b5c0a6843c4ae3/track.yml 
[2024-04-15 14:40:24] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/i-059b5c0a6843c4ae3/track.yml
[2024-04-15 14:40:56] [INFO] ALLOCATOR: Instance i-059b5c0a6843c4ae3 deleted.
c-bordon commented 1 month ago

Windows desktop 10

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa$ python3 deployability/modules/allocation/main.py --provider aws --size large --label-team devops --label-termination-date "1d" --composite-name windows-desktop-10-amd64
[2024-04-15 14:57:38] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-04-15 14:57:38] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-04-15 14:57:38] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-2FF7F830-C6DB-46A0-9A5F-A4465B20E865
[2024-04-15 14:57:56] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-2FF7F830-C6DB-46A0-9A5F-A4465B20E865 directory to /tmp/wazuh-qa/i-0997c876fccb48994
[2024-04-15 14:57:56] [INFO] ALLOCATOR: Instance i-0997c876fccb48994 created.
[2024-04-15 14:57:58] [INFO] ALLOCATOR: Instance i-0997c876fccb48994 started.
[2024-04-15 14:57:58] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/i-0997c876fccb48994/inventory.yml
[2024-04-15 14:58:28] [WARNING] ALLOCATOR: Error on attempt 1 of 15: HTTPSConnectionPool(host='ec2-54-198-105-196.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7c5eccf89090>, 'Connection to ec2-54-198-105-196.compute-1.amazonaws.com timed out. (connect timeout=30)'))
[2024-04-15 14:59:28] [WARNING] ALLOCATOR: Error on attempt 2 of 15: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 15:00:29] [WARNING] ALLOCATOR: Error on attempt 3 of 15: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 15:01:29] [WARNING] ALLOCATOR: Error on attempt 4 of 15: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 15:02:30] [WARNING] ALLOCATOR: Error on attempt 5 of 15: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 15:03:30] [WARNING] ALLOCATOR: Error on attempt 6 of 15: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 15:04:30] [WARNING] ALLOCATOR: Error on attempt 7 of 15: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 15:05:31] [WARNING] ALLOCATOR: Error on attempt 8 of 15: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 15:06:31] [WARNING] ALLOCATOR: Error on attempt 9 of 15: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 15:07:32] [WARNING] ALLOCATOR: Error on attempt 10 of 15: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2024-04-15 15:08:53] [WARNING] ALLOCATOR: Error on attempt 11 of 15: 
[2024-04-15 15:09:56] [INFO] ALLOCATOR: WinRM connection successful.
[2024-04-15 15:09:56] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/i-0997c876fccb48994/track.yml
c-bordon commented 1 month ago

Windows 11

Regarding Windows 11, we are going to proceed to disable this AMI as an Allocator deployment option due to this issue: https://github.com/wazuh/wazuh-automation/issues/1582. The current Windows 11 AMI does not allow Sysprep configurations, therefore the User Data script that we need to perform configurations does not work.

The other option is to use this AMI with the Jenkins user and its password, this would cause all machines created from this AMI to be accessed with the same password.

Screenshot_20240415_164102

rauldpm commented 1 month ago

LGTM

fcaffieri commented 1 month ago

LGTM