wazuh / wazuh-qa

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

DTT1 - Iteration 3 - Allocation module - Add deploy of macOS host for macOS EC2 instances #4929

Closed c-bordon closed 1 month ago

c-bordon commented 3 months ago

For the deployment of EC2 macOS instances, we need to previously provision a dedicated host, the deployment process should consider the prior provisioning of this dedicated host for macOS, in turn, it should allow us the possibility of reusing a host that already exists previously.

In the case of the delete option, it should be possible to delete both, with the clarification that a dedicated host must remain reserved for at least 24 hours, so, if you cannot delete the dedicated host, you must notify this. to the user or system.

c-bordon commented 3 months ago

Update report

I was working on the first functions to be able to identify which provider to use according to the macOS version. The problem that arises is that in the case of some versions, we have to first validate availability to deploy on macStadium or on the Black mini. Wazuh. For this we need to know the load status of both hosts, that is, we should obtain the private IP addresses of these machines, possibly we need to bring this secret information.

On the other hand, if we cannot deploy them with vagrant, we should be able to deploy them in AWS

c-bordon commented 2 months ago

Update report

In a review we did with @teddytpc1 we defined that the script only raise macOS instances in AWS and macStadium according to availability.

I was working on the deployment of the instances in AWS, and on the validation for the case of macStadium:

macStadium validation:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.7.3-arm64 --provider aws --size micro --label-issue https://github.com/wazuh/wazuh-qa/issues/4929 --label-team devops --label-termination-date "2024-02-19 21:00:00" --ssh-key ~/.ssh/allocation_test
[2024-02-19 16:45:31] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-02-19 16:45:36] [INFO] ALLOCATOR: macStadium server has 2 VMs running, using aws provider.
[2024-02-19 16:45:36] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-02-19 16:45:36] [DEBUG] ALLOCATOR: Using provided key pair
[2024-02-19 16:45:37] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-14750917-5BEE-48E8-AE76-B05D5CF2EFFB
[2024-02-19 16:45:54] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-14750917-5BEE-48E8-AE76-B05D5CF2EFFB directory to /tmp/wazuh-qa/i-096e6c63e9235d300
[2024-02-19 16:45:54] [INFO] ALLOCATOR: Instance i-096e6c63e9235d300 created.
[2024-02-19 16:45:56] [INFO] ALLOCATOR: Instance i-096e6c63e9235d300 started.
h-04f1ce0fa7468ee27
[2024-02-19 16:45:56] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-02-19 16:45:56] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.7.3-arm64 --provider aws --size micro --label-issue https://github.com/wazuh/wazuh-qa/issues/4929 --label-team devops --label-termination-date "2024-02-19 21:00:00" --ssh-key ~/.ssh/allocation_test
[2024-02-19 15:22:36] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-02-19 15:22:41] [INFO] ALLOCATOR: macStadium server has less than 2 VMs running, using vagrant provider.
[2024-02-19 15:22:41] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-02-19 15:22:41] [DEBUG] ALLOCATOR: Using provided key pair

In the case of AWS, I have already been developing the necessary functions to provision a dedicated host, and then provision the EC2 instance with the indicated macOS version:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.7.3-amd64 --provider aws --size micro --label-issue https://github.com/wazuh/wazuh-qa/issues/4929 --label-team devops --label-termination-date "2024-02-19 21:00:00" --ssh-key ~/.ssh/allocation_test
[2024-02-19 16:34:17] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-02-19 16:34:17] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-02-19 16:34:17] [DEBUG] ALLOCATOR: Using provided key pair
[2024-02-19 16:34:18] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-914D1420-F867-4E7E-AA02-2B4F596A8518
[2024-02-19 16:34:35] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-914D1420-F867-4E7E-AA02-2B4F596A8518 directory to /tmp/wazuh-qa/i-0aec4d38671fd0977
[2024-02-19 16:34:35] [INFO] ALLOCATOR: Instance i-0aec4d38671fd0977 created.
[2024-02-19 16:34:37] [INFO] ALLOCATOR: Instance i-0aec4d38671fd0977 started.
h-008e0fefd5f7cc8a8
[2024-02-19 16:34:37] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-02-19 16:34:37] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml

New data is added to the track file, which is the id of the reserved instance, this will allow us to try to delete this instance after the VM is released.

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
host_identifier: h-04f1ce0fa7468ee27
identifier: i-096e6c63e9235d300
instance_dir: /tmp/wazuh-qa/i-096e6c63e9235d300
key_path: /home/cbordon/.ssh/allocation_test
provider: aws

I am working on the process of eliminating the dedicated machine.

c-bordon commented 2 months ago

Update report

These are the most common messages we can get when trying to release a macOS dedicated host:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider aws --action delete --track-output /tmp/wazuh-qa/track.yml
[2024-02-20 09:24:59] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-02-20 09:24:59] [INFO] ALLOCATOR: Releasing dedicated host: h-008e0fefd5f7cc8a8
[2024-02-20 09:25:00] [INFO] ALLOCATOR: Unable to release Dedicated Host h-008e0fefd5f7cc8a8. mac1.metal hosts must be allocated to your AWS account for at least 24 hour(s). You can release this host any time after 2024-02-20T18:17:04.915Z.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider aws --action delete --track-output /tmp/wazuh-qa/track.yml
[2024-02-20 09:24:04] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-02-20 09:24:04] [INFO] ALLOCATOR: Releasing dedicated host: h-0851f37c8cf8f848a
[2024-02-20 09:24:05] [INFO] ALLOCATOR: Dedicated host 'h-0851f37c8cf8f848a' cannot be released as it is occupied.

Deploy and release macOS EC2 instance

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.7.3-amd64 --provider aws --size micro --label-issue https://github.com/wazuh/wazuh-qa/issues/4929 --label-team devops --label-termination-date "2024-02-19 21:00:00" --ssh-key ~/.ssh/allocation_test
[2024-02-20 09:55:32] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-02-20 09:55:32] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-02-20 09:55:32] [DEBUG] ALLOCATOR: Using provided key pair
[2024-02-20 09:55:33] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-28DF05A4-E143-4275-B402-2B5D47B73884
[2024-02-20 09:55:51] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-28DF05A4-E143-4275-B402-2B5D47B73884 directory to /tmp/wazuh-qa/i-0b079b2c524b152e3
[2024-02-20 09:55:51] [INFO] ALLOCATOR: Instance i-0b079b2c524b152e3 created.
[2024-02-20 09:55:52] [INFO] ALLOCATOR: Instance i-0b079b2c524b152e3 started.
[2024-02-20 09:55:52] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-02-20 09:55:52] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider aws --action delete --track-output /tmp/wazuh-qa/track.yml
[2024-02-20 09:56:22] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-02-20 10:04:51] [INFO] ALLOCATOR: Releasing dedicated host: h-008e0fefd5f7cc8a8
[2024-02-20 10:04:52] [INFO] ALLOCATOR: Dedicated host 'h-008e0fefd5f7cc8a8' cannot be released as it is occupied.
[2024-02-20 10:04:52] [INFO] ALLOCATOR: Instance i-0b079b2c524b152e3 deleted.
c-bordon commented 2 months ago

AWS

Creating a Linux EC2 instance

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name linux-ubuntu-22.04-amd64 --provider aws --size micro --label-issue https://github.com/wazuh/wazuh-qa/issues/4929 --label-team devops --label-termination-date "2024-02-19 21:00:00" --ssh-key ~/.ssh/allocation_test
[2024-02-20 11:59:13] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-02-20 11:59:13] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-02-20 11:59:13] [DEBUG] ALLOCATOR: Using provided key pair
[2024-02-20 11:59:14] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-8B7658D2-B53B-4681-97FD-094613C00183
[2024-02-20 11:59:32] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-8B7658D2-B53B-4681-97FD-094613C00183 directory to /tmp/wazuh-qa/i-01106607bd99b2afd
[2024-02-20 11:59:32] [INFO] ALLOCATOR: Instance i-01106607bd99b2afd created.
[2024-02-20 11:59:34] [INFO] ALLOCATOR: Instance i-01106607bd99b2afd started.
[2024-02-20 11:59:34] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-02-20 11:59:34] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
host_identifier: null
identifier: i-01106607bd99b2afd
instance_dir: /tmp/wazuh-qa/i-01106607bd99b2afd
key_path: /home/cbordon/.ssh/allocation_test
provider: aws
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider aws --action delete --track-output /tmp/wazuh-qa/track.yml
[2024-02-20 12:00:00] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-02-20 12:01:19] [INFO] ALLOCATOR: Instance i-01106607bd99b2afd deleted.

Creating a macOS instance

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.7.3-amd64 --provider aws --size micro --label-issue https://github.com/wazuh/wazuh-qa/issues/4929 --label-team devops --label-termination-date "2024-02-19 21:00:00" --ssh-key ~/.ssh/allocation_test
[2024-02-20 12:21:53] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-02-20 12:21:54] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-02-20 12:21:54] [DEBUG] ALLOCATOR: Using provided key pair
[2024-02-20 12:21:54] [INFO] ALLOCATOR: Creating dedicated host: wazuh-qa-4929-monterey-12.7.3-Host-amd64
[2024-02-20 12:21:56] [INFO] ALLOCATOR: Dedicated host created: h-0e90dd5835cd5378d
[2024-02-20 12:21:56] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-D4FF5B7A-A590-426F-ABA9-C3C39F14FB2E
[2024-02-20 12:22:14] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-D4FF5B7A-A590-426F-ABA9-C3C39F14FB2E directory to /tmp/wazuh-qa/i-0a6087dbbb2a866ae
[2024-02-20 12:22:14] [INFO] ALLOCATOR: Instance i-0a6087dbbb2a866ae created.
[2024-02-20 12:22:15] [INFO] ALLOCATOR: Instance i-0a6087dbbb2a866ae started.
[2024-02-20 12:22:15] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-02-20 12:22:15] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider aws --action delete --track-output /tmp/wazuh-qa/track.yml
[2024-02-20 12:23:54] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-02-20 12:32:21] [INFO] ALLOCATOR: Releasing dedicated host: h-0e90dd5835cd5378d
[2024-02-20 12:32:22] [INFO] ALLOCATOR: Dedicated host 'h-0e90dd5835cd5378d' cannot be released as it is occupied.
[2024-02-20 12:32:22] [INFO] ALLOCATOR: Instance i-0a6087dbbb2a866ae deleted.
c-bordon commented 2 months ago

AWS

Dedicated host released:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider aws --action delete --track-output /tmp/wazuh-qa/track.yml
[2024-02-20 15:23:08] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-02-20 15:23:08] [INFO] ALLOCATOR: Releasing dedicated host: h-008e0fefd5f7cc8a8
[2024-02-20 15:23:09] [INFO] ALLOCATOR: Dedicated host released: h-008e0fefd5f7cc8a8
c-bordon commented 2 months ago

Vagrant

I found some issues when I tried to deploy the macOS machine with the same vagrant file (edited for parallels) we use in the local machine.

At first I think that the problem comes from the configuration of the private key, I am testing to leave a vagrant file that allows us to create this type of instances in a similar way to what we do with Linux machines.

sh-3.2# vagrant up macos-12
Bringing machine 'macos-12' up with 'parallels' provider...
==> macos-12: Registering VM image from the base box 'macos-12'...
==> macos-12: Creating new virtual machine as a full clone of the box image...
==> macos-12: Unregistering the box VM image...
==> macos-12: Setting the default configuration for VM...
==> macos-12: Setting the name of the VM: undefined_macos_instance_2024-02-21T19:37:03Z
==> macos-12: Preparing network interfaces based on configuration...
    macos-12: Adapter 0: shared
    macos-12: Adapter 1: hostonly
    macos-12: Adapter 2: bridged
==> macos-12: Clearing any previously set network interfaces...
==> macos-12: Running 'pre-boot' VM customizations...
==> macos-12: Booting VM...
==> macos-12: Waiting for machine to boot. This may take a few minutes...
    macos-12: SSH address: 192.168.64.4:22
    macos-12: SSH username: vagrant
    macos-12: SSH auth method: private key
    macos-12: Warning: Host unreachable. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host unreachable. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host unreachable. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host appears down. Retrying...
    macos-12: Warning: Host unreachable. Retrying...
    macos-12: Warning: Host appears down. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
c-bordon commented 2 months ago

Update report

I continue working on the necessary changes to be able to deploy on macStadium using vagrant, at the moment I am working on the necessary modules to perform ssh tunneling to establish a connection with the VM

c-bordon commented 2 months ago

Vagrant

I managed to perform a deploy in macStadium updating the output files with all the necessary information, now I am going to work on deleting the instance:

deploy

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.6-arm64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test
[2024-02-23 12:02:27] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-02-23 12:02:32] [INFO] ALLOCATOR: macStadium server has less than 2 VMs running, using Vagrant provider.
[2024-02-23 12:02:32] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-02-23 12:02:37] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-02-23 12:02:37] [DEBUG] ALLOCATOR: Using provided key pair
[2024-02-23 12:02:40] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-02-23 12:02:45] [INFO] ALLOCATOR: Instance VAGRANT-A463F89A-B32B-4CF1-87EF-A2EA7D1213BA created.
[2024-02-23 12:03:58] [INFO] ALLOCATOR: Instance VAGRANT-A463F89A-B32B-4CF1-87EF-A2EA7D1213BA started.
[2024-02-23 12:04:21] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-02-23 12:04:34] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml

inventory.yml

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/inventory.yml
ansible_host: 10.10.0.250
ansible_password: vagrant
ansible_port: 43220
ansible_ssh_private_key_file: None
ansible_user: vagrant

track.yml

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
host_identifier: /Users/jenkins/testing/VAGRANT-A463F89A-B32B-4CF1-87EF-A2EA7D1213BA
identifier: VAGRANT-A463F89A-B32B-4CF1-87EF-A2EA7D1213BA
instance_dir: /tmp/wazuh-qa/VAGRANT-A463F89A-B32B-4CF1-87EF-A2EA7D1213BA
key_path: /home/cbordon/.ssh/allocation_test
provider: vagrant
ssh_port: 43220

ssh connection

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ sshpass -p vagrant ssh -p 43220 vagrant@10.10.0.250
Last login: Fri Feb 23 07:06:14 2024
vagrant@macos-12 ~ % sw_vers
ProductName:    macOS
ProductVersion: 12.6
BuildVersion:   21G115
vagrant@macos-12 ~ % exit

Remote dir

sh-3.2# pwd
/Users/jenkins/testing/VAGRANT-A463F89A-B32B-4CF1-87EF-A2EA7D1213BA
sh-3.2# ls -la
total 8
drwxr-xr-x  4 jenkins  staff  128 Feb 23 07:02 .
drwxr-xr-x  7 jenkins  staff  224 Feb 23 07:02 ..
drwxr-xr-x  5 root     staff  160 Feb 23 07:02 .vagrant
-rw-r--r--  1 jenkins  staff  549 Feb 23 07:02 Vagrantfile
sh-3.2# pwd
/Users/jenkins/testing/VAGRANT-A463F89A-B32B-4CF1-87EF-A2EA7D1213BA
sh-3.2# ls -la
total 8
drwxr-xr-x  4 jenkins  staff  128 Feb 23 07:02 .
drwxr-xr-x  7 jenkins  staff  224 Feb 23 07:02 ..
drwxr-xr-x  5 root     staff  160 Feb 23 07:02 .vagrant
-rw-r--r--  1 jenkins  staff  549 Feb 23 07:02 Vagrantfile
sh-3.2# vagrant status
Current machine states:

default                   running (parallels)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
sh-3.2# prlctl list
UUID                                    STATUS       IP_ADDR         NAME
{abb22a33-54bd-4af2-ba73-ba2ffec3cf38}  running      -               VAGRANT-A463F89A-B32B-4CF1-87EF-A2EA7D1213BA
sh-3.2#
c-bordon commented 2 months ago

Vagrant

Create and delete macOS instance

local machine

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.6-arm64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test
[2024-02-23 12:37:52] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-02-23 12:37:57] [INFO] ALLOCATOR: macStadium server has less than 2 VMs running, using Vagrant provider.
[2024-02-23 12:37:57] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-02-23 12:38:02] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-02-23 12:38:02] [DEBUG] ALLOCATOR: Using provided key pair
[2024-02-23 12:38:05] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-02-23 12:38:10] [INFO] ALLOCATOR: Instance VAGRANT-4300B9AE-8C2B-4A7B-861F-665E586D3210 created.
[2024-02-23 12:39:20] [INFO] ALLOCATOR: Instance VAGRANT-4300B9AE-8C2B-4A7B-861F-665E586D3210 started.
[2024-02-23 12:39:43] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-02-23 12:39:56] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
host_identifier: /Users/jenkins/testing/VAGRANT-4300B9AE-8C2B-4A7B-861F-665E586D3210
identifier: VAGRANT-4300B9AE-8C2B-4A7B-861F-665E586D3210
instance_dir: /tmp/wazuh-qa/VAGRANT-4300B9AE-8C2B-4A7B-861F-665E586D3210
key_path: /home/cbordon/.ssh/allocation_test
provider: vagrant
ssh_port: 43220
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ sshpass -p vagrant ssh -p 43220 vagrant@10.10.0.250
Last login: Fri Feb 23 07:39:00 2024
vagrant@macos-12 ~ % exit
Connection to 10.10.0.250 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/track.yml
[2024-02-23 12:40:54] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-02-23 12:40:54] [DEBUG] ALLOCATOR: Destroying instance VAGRANT-4300B9AE-8C2B-4A7B-861F-665E586D3210
[2024-02-23 12:41:12] [DEBUG] ALLOCATOR: Deleting remote directory /Users/jenkins/testing/VAGRANT-4300B9AE-8C2B-4A7B-861F-665E586D3210
[2024-02-23 12:41:17] [DEBUG] ALLOCATOR: Killing remote process on port 43220
[2024-02-23 12:41:26] [INFO] ALLOCATOR: Instance VAGRANT-4300B9AE-8C2B-4A7B-861F-665E586D3210 deleted.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ls -la /tmp/wazuh-qa/
total 68
drwxrwxr-x  4 cbordon cbordon  4096 feb 23 12:41 .
drwxrwxrwt 31 root    root    45056 feb 23 12:35 ..
-rw-rw-r--  1 cbordon cbordon   129 feb 23 12:39 inventory.yml
-rw-rw-r--  1 cbordon cbordon   294 feb 23 12:39 track.yml
drwxrwxr-x  2 cbordon cbordon  4096 feb 23 11:56 VAGRANT-59FC9DA2-5611-4DD3-BCE0-98DEDE047BC1
drwxrwxr-x  2 cbordon cbordon  4096 feb 23 12:01 VAGRANT-966DE3DD-98B8-461F-88F2-37DC2E705B8E
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$

remote machine

before delete
sh-3.2# ls -la
total 0
drwxr-xr-x   7 jenkins  staff   224 Feb 23 07:38 .
drwxr-x---+ 34 jenkins  staff  1088 Feb 23 05:00 ..
drwxr-xr-x   4 root     staff   128 Jan 15 04:56 689
drwxr-xr-x   4 jenkins  staff   128 Feb 23 07:38 VAGRANT-4300B9AE-8C2B-4A7B-861F-665E586D3210
drwxr-xr-x   4 root     staff   128 Sep  8 08:11 macos-testing
drwxr-xr-x   2 root     staff    64 Feb 21 05:17 testing_dir
drwxr-xr-x   4 root     staff   128 Aug 22  2023 wpk-testing
sh-3.2# prlctl list
UUID                                    STATUS       IP_ADDR         NAME
{f90340ef-f302-4bc9-98e1-453a663a7727}  running      -               VAGRANT-4300B9AE-8C2B-4A7B-861F-665E586D3210
after delete
sh-3.2# prlctl list
UUID                                    STATUS       IP_ADDR         NAME
sh-3.2# ls -la
total 0
drwxr-xr-x   6 jenkins  staff   192 Feb 23 07:41 .
drwxr-x---+ 34 jenkins  staff  1088 Feb 23 05:00 ..
drwxr-xr-x   4 root     staff   128 Jan 15 04:56 689
drwxr-xr-x   4 root     staff   128 Sep  8 08:11 macos-testing
drwxr-xr-x   2 root     staff    64 Feb 21 05:17 testing_dir
drwxr-xr-x   4 root     staff   128 Aug 22  2023 wpk-testing
sh-3.2# lsof -Pi :43220 -sTCP:LISTEN -t
sh-3.2#
c-bordon commented 2 months ago

AWS

Create and delete Linux instance in AWS


github.com/wazuh/wazuh-qa/issues/4929 --label-team devops --label-termination-date "2024-02-23 15:00:00"
[2024-02-23 14:39:33] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-02-23 14:39:33] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-02-23 14:39:33] [DEBUG] ALLOCATOR: Using provided key pair
[2024-02-23 14:39:34] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-467ADA61-0AFD-4D2F-89D9-F9B588FC8E90
[2024-02-23 14:39:51] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-467ADA61-0AFD-4D2F-89D9-F9B588FC8E90 directory to /tmp/wazuh-qa/i-0c3acf2d432754439
[2024-02-23 14:39:52] [INFO] ALLOCATOR: Instance i-0c3acf2d432754439 created.
[2024-02-23 14:39:53] [INFO] ALLOCATOR: Instance i-0c3acf2d432754439 started.
[2024-02-23 14:39:53] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-02-23 14:39:53] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/inventory.yml
ansible_host: ec2-44-202-221-236.compute-1.amazonaws.com
ansible_password: None
ansible_port: 22
ansible_ssh_private_key_file: /home/cbordon/.ssh/allocation_test
ansible_user: ubuntu
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
host_identifier: None
identifier: i-0c3acf2d432754439
instance_dir: /tmp/wazuh-qa/i-0c3acf2d432754439
key_path: /home/cbordon/.ssh/allocation_test
provider: aws
ssh_port: 22
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ls -la /tmp/wazuh-qa/
total 64
drwxrwxr-x  3 cbordon cbordon  4096 feb 23 14:39 .
drwxrwxrwt 38 root    root    45056 feb 23 14:43 ..
drwxrwxr-x  2 cbordon cbordon  4096 feb 23 14:39 i-0c3acf2d432754439
-rw-rw-r--  1 cbordon cbordon   183 feb 23 14:39 inventory.yml
-rw-rw-r--  1 cbordon cbordon   174 feb 23 14:39 track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -i /home/cbordon/.ssh/allocation_test ubuntu@ec2-44-202-221-236.compute-1.amazonaws.com
The authenticity of host 'ec2-44-202-221-236.compute-1.amazonaws.com (44.202.221.236)' can't be established.
ED25519 key fingerprint is SHA256:2SvCPgF1Xy/Vp/ar4c8yv3FIKPxtsT920wxL3fGydbo.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'ec2-44-202-221-236.compute-1.amazonaws.com' (ED25519) to the list of known hosts.
Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.19.0-1025-aws x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Fri Feb 23 17:40:57 UTC 2024

  System load:  0.29638671875     Processes:             111
  Usage of /:   20.6% of 7.57GB   Users logged in:       0
  Memory usage: 23%               IPv4 address for ens5: 172.31.10.175
  Swap usage:   0%

Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status

The list of available updates is more than a week old.
To check for new updates run: sudo apt update

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@ip-172-31-10-175:~$ exit
logout
Connection to ec2-44-202-221-236.compute-1.amazonaws.com closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ls -la /tmp/wazuh-qa/
total 60
drwxrwxr-x  2 cbordon cbordon  4096 feb 23 14:46 .
drwxrwxrwt 38 root    root    45056 feb 23 14:46 ..
-rw-rw-r--  1 cbordon cbordon   183 feb 23 14:39 inventory.yml
-rw-rw-r--  1 cbordon cbordon   174 feb 23 14:39 track.yml

Screenshot_20240223_144023 Screenshot_20240223_144632

c-bordon commented 2 months ago

Update report

I am working on adapting the deployment of macOS Intel machines on the Black Mini, I had to make several changes to the logic, which I continue to make.

At the moment I am working on storing the port configured for the machine created on the Black Mini, I have to make changes to the configuration parsing methods.

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.0.1-amd64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test
[2024-03-04 16:44:15] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-04 16:44:15] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-03-04 16:44:30] [INFO] ALLOCATOR: Using the black mini server to deploy.
[2024-03-04 16:44:34] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-04 16:44:34] [DEBUG] ALLOCATOR: Using provided key pair
Traceback (most recent call last):
  File "/home/cbordon/Documents/wazuh/repositorios/wazuh-qa/deployability/launchers/allocation.py", line 33, in <module>
    main()
  File "/home/cbordon/Documents/wazuh/repositorios/wazuh-qa/deployability/launchers/allocation.py", line 29, in main
    Allocator.run(InputPayload(**vars(parse_arguments())))
  File "/home/cbordon/Documents/wazuh/repositorios/wazuh-qa/deployability/modules/allocation/allocation.py", line 31, in run
    return cls.__create(payload)
  File "/home/cbordon/Documents/wazuh/repositorios/wazuh-qa/deployability/modules/allocation/allocation.py", line 50, in __create
    instance = provider.create_instance(
  File "/home/cbordon/Documents/wazuh/repositorios/wazuh-qa/deployability/modules/allocation/generic/provider.py", line 66, in create_instance
    return cls._create_instance(base_dir, params, config, ssh_key)
  File "/home/cbordon/Documents/wazuh/repositorios/wazuh-qa/deployability/modules/allocation/vagrant/provider.py", line 71, in _create_instance
    config = cls.__parse_config(params, credentials, instance_id, macos_host_parameters)
  File "/home/cbordon/Documents/wazuh/repositorios/wazuh-qa/deployability/modules/allocation/vagrant/provider.py", line 187, in __parse_config
    tmp_port_file = str(self.path) + "/port.txt"
NameError: name 'self' is not defined
c-bordon commented 2 months ago

Update report

It is possible to generate the necessary changes to be able to deploy and delete a macOS instance on the black mini AMD64.

I have to carry out tests and adaptations of all the impacts that these changes can generate on other deployments:

Local execution:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.0.1-amd64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test
[2024-03-05 16:47:22] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-05 16:47:22] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-03-05 16:47:36] [INFO] ALLOCATOR: Using the black mini server to deploy.
[2024-03-05 16:47:40] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-05 16:47:40] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-05 16:47:47] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-03-05 16:47:52] [INFO] ALLOCATOR: Instance VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD created.
[2024-03-05 16:52:07] [ERROR] ALLOCATOR: Command failed: Sorry, don't know how to check guest version of Virtualbox Guest Additions on this platform. Stopping installation.

[2024-03-05 16:52:07] [INFO] ALLOCATOR: Instance VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD started.
[2024-03-05 16:52:19] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-03-05 16:52:31] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/inventory.yml
ansible_host: 10.10.0.251
ansible_password: vagrant
ansible_port: 43220
ansible_ssh_private_key_file: None
ansible_user: vagrant
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
arch: amd64
host_identifier: black_mini
host_instance_dir: /Users/jenkins/testing/VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD
identifier: VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD
instance_dir: /tmp/wazuh-qa/VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD
key_path: /home/cbordon/.ssh/allocation_test
platform: macos
provider: vagrant
ssh_port: 43220
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -p 43220 vagrant@10.10.0.251
(vagrant@10.10.0.251) Password:
Last login: Tue Mar  5 20:52:10 2024
vagrant@MacBook-Pro ~ % sw_vers
ProductName:    macOS
ProductVersion: 12.0.1
BuildVersion:   21A559
vagrant@MacBook-Pro ~ % exit
Connection to 10.10.0.251 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/track.yml
[2024-03-05 16:54:37] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-03-05 16:54:39] [DEBUG] ALLOCATOR: Destroying instance VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD
[2024-03-05 16:54:54] [DEBUG] ALLOCATOR: Deleting remote directory /Users/jenkins/testing/VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD
[2024-03-05 16:54:58] [INFO] ALLOCATOR: Instance VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD deleted.

Remote execution

Jenkins-mac-mini-2:testing root# ls -la
total 0
drwxr-xr-x   3 jenkins  staff    96 Mar  5 20:47 .
drwxr-xr-x@ 69 jenkins  staff  2208 Mar  5 18:45 ..
drwxr-xr-x   4 root     staff   128 Mar  5 20:47 VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD
Jenkins-mac-mini-2:testing root# cd VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD/
Jenkins-mac-mini-2:VAGRANT-A2D692DE-7816-462E-ADC7-35A2F37776AD root# vagrant status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
Jenkins-mac-mini-2:testing root# ls -la
total 0
drwxr-xr-x   2 jenkins  staff    64 Mar  5 20:54 .
drwxr-xr-x@ 69 jenkins  staff  2208 Mar  5 18:45 ..
c-bordon commented 2 months ago

Update report

Deploying without VPN connection:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.0.1-amd64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test
[2024-03-06 08:49:13] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-06 08:49:13] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-03-06 08:49:19] [ERROR] ALLOCATOR: Could not connect to macOS Black mini server: timed out.

Deploying without Secret Manager permissions:

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.0.1-amd64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test
[2024-03-06 08:50:51] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-06 08:50:51] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-03-06 08:50:52] [ERROR] ALLOCATOR: Could not get macOS Black mini server IP: An error occurred (AccessDeniedException) when calling the GetSecretValue operation: User: arn:aws:iam::xxx:user/carlos.bordon is not authorized to perform: secretsmanager:GetSecretValue on resource: devops_black_mini_jenkins_ip because no identity-based policy allows the secretsmanager:GetSecretValue action.
c-bordon commented 2 months ago

Vagrant ARM

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.6-arm64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test
[2024-03-06 09:41:21] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-06 09:41:21] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-03-06 09:41:26] [INFO] ALLOCATOR: macStadium server has less than 2 VMs running, deploying in this host.
[2024-03-06 09:41:30] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-06 09:41:30] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-06 09:41:33] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-03-06 09:41:37] [INFO] ALLOCATOR: Instance VAGRANT-A7FD1A95-9C5B-4B64-AB74-C1D58313DB5D created.
[2024-03-06 09:42:13] [INFO] ALLOCATOR: Instance VAGRANT-A7FD1A95-9C5B-4B64-AB74-C1D58313DB5D started.
[2024-03-06 09:42:31] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-03-06 09:42:42] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/inventory.yml
ansible_host: 10.10.0.250
ansible_password: vagrant
ansible_port: 43220
ansible_ssh_private_key_file: None
ansible_user: vagrant
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
arch: arm64
host_identifier: macstadium
host_instance_dir: /Users/jenkins/testing/VAGRANT-A7FD1A95-9C5B-4B64-AB74-C1D58313DB5D
identifier: VAGRANT-A7FD1A95-9C5B-4B64-AB74-C1D58313DB5D
instance_dir: /tmp/wazuh-qa/VAGRANT-A7FD1A95-9C5B-4B64-AB74-C1D58313DB5D
key_path: /home/cbordon/.ssh/allocation_test
platform: macos
provider: vagrant
ssh_port: 43220
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -p 43220 vagrant@10.10.0.250
The authenticity of host '[10.10.0.250]:43220 ([10.10.0.250]:43220)' can't be established.
ED25519 key fingerprint is SHA256:eECJhAinQyW6O029Dl9FdG0nDJ1DfoAEyjqsBt4wySk.
This host key is known by the following other names/addresses:
    ~/.ssh/known_hosts:356: [hashed name]
    ~/.ssh/known_hosts:363: [hashed name]
    ~/.ssh/known_hosts:406: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[10.10.0.250]:43220' (ED25519) to the list of known hosts.
(vagrant@10.10.0.250) Password:
Last login: Wed Mar  6 04:41:58 2024
vagrant@macos-12 ~ % sw_vers
ProductName:    macOS
ProductVersion: 12.6
BuildVersion:   21G115
vagrant@macos-12 ~ % exit
Connection to 10.10.0.250 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/track.yml
[2024-03-06 09:44:00] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-03-06 09:44:02] [DEBUG] ALLOCATOR: Destroying instance VAGRANT-A7FD1A95-9C5B-4B64-AB74-C1D58313DB5D
[2024-03-06 09:44:16] [DEBUG] ALLOCATOR: Deleting remote directory /Users/jenkins/testing/VAGRANT-A7FD1A95-9C5B-4B64-AB74-C1D58313DB5D
[2024-03-06 09:44:20] [DEBUG] ALLOCATOR: Killing remote process on port 43220
[2024-03-06 09:44:27] [INFO] ALLOCATOR: Instance VAGRANT-A7FD1A95-9C5B-4B64-AB74-C1D58313DB5D deleted.

Remote machine

sh-3.2# ls -la
total 0
drwxr-xr-x   7 jenkins  staff   224 Mar  6 04:41 .
drwxr-x---+ 34 jenkins  staff  1088 Mar  6 04:09 ..
drwxr-xr-x   4 root     staff   128 Jan 15 04:56 689
drwxr-xr-x   4 jenkins  staff   128 Mar  6 04:41 VAGRANT-A7FD1A95-9C5B-4B64-AB74-C1D58313DB5D
drwxr-xr-x   4 root     staff   128 Sep  8 08:11 macos-testing
drwxr-xr-x   2 root     staff    64 Feb 21 05:17 testing_dir
drwxr-xr-x   4 root     staff   128 Aug 22  2023 wpk-testing
sh-3.2# cd VAGRANT-A7FD1A95-9C5B-4B64-AB74-C1D58313DB5D/
sh-3.2# vagrant status
Current machine states:

default                   running (parallels)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
sh-3.2# cd ..
sh-3.2# ls -la
total 0
drwxr-xr-x   6 jenkins  staff   192 Mar  6 04:44 .
drwxr-x---+ 34 jenkins  staff  1088 Mar  6 04:09 ..
drwxr-xr-x   4 root     staff   128 Jan 15 04:56 689
drwxr-xr-x   4 root     staff   128 Sep  8 08:11 macos-testing
drwxr-xr-x   2 root     staff    64 Feb 21 05:17 testing_dir
drwxr-xr-x   4 root     staff   128 Aug 22  2023 wpk-testing
sh-3.2# prlctl list -a
UUID                                    STATUS       IP_ADDR         NAME
{dc9500f6-220b-4127-8c40-4aaba63eb681}  stopped      -               Test_install_B155251_20240306115129
sh-3.2# lsof -Pi :43220 -sTCP:LISTEN -t
sh-3.2#
c-bordon commented 2 months ago

Vagrant

Local deploy without instance-name parameter

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name linux-ubuntu-16.04-amd64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test[2024-03-06 11:57:21] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-06 11:57:21] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-06 11:57:21] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-06 11:57:24] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-03-06 11:57:24] [INFO] ALLOCATOR: Instance VAGRANT-0A7E29E1-7B28-43D8-AB61-553E661F9433 created.
[2024-03-06 11:58:04] [INFO] ALLOCATOR: Instance VAGRANT-0A7E29E1-7B28-43D8-AB61-553E661F9433 started.
[2024-03-06 11:58:07] [DEBUG] ALLOCATOR: Using provided credentials
[2024-03-06 11:58:07] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-03-06 11:58:10] [DEBUG] ALLOCATOR: Using provided credentials
[2024-03-06 11:58:10] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/inventory.yml
ansible_host: 192.168.57.2
ansible_password: None
ansible_port: 22
ansible_ssh_private_key_file: /home/cbordon/.ssh/allocation_test
ansible_user: vagrant
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
arch: amd64
host_identifier: None
host_instance_dir: None
identifier: VAGRANT-0A7E29E1-7B28-43D8-AB61-553E661F9433
instance_dir: /tmp/wazuh-qa/VAGRANT-0A7E29E1-7B28-43D8-AB61-553E661F9433
key_path: /home/cbordon/.ssh/allocation_test
platform: linux
provider: vagrant
ssh_port: 22
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -i /home/cbordon/.ssh/allocation_test vagrant@192.168.57.2
The authenticity of host '192.168.57.2 (192.168.57.2)' can't be established.
ED25519 key fingerprint is SHA256:NwHEbjy7i6VCA/OoiAKZA6js4+7L/TG+8NVfOwMkFIs.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.57.2' (ED25519) to the list of known hosts.
vagrant@ubuntu1604:~$ exit
logout
Connection to 192.168.57.2 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/track.yml
[2024-03-06 11:58:56] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-03-06 11:58:56] [DEBUG] ALLOCATOR: The key /home/cbordon/.ssh/allocation_test will not be deleted. It is the user's responsibility to delete it.
[2024-03-06 11:58:56] [DEBUG] ALLOCATOR: Destroying instance VAGRANT-0A7E29E1-7B28-43D8-AB61-553E661F9433
[2024-03-06 11:59:02] [INFO] ALLOCATOR: Instance VAGRANT-0A7E29E1-7B28-43D8-AB61-553E661F9433 deleted.

Screenshot_20240306_115849

c-bordon commented 2 months ago

Vagrant

Local deploy with instance-name parameter

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name linux-ubuntu-16.04-amd64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test --instance-name Test_install_4589
[2024-03-06 12:03:33] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-06 12:03:33] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-06 12:03:33] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-06 12:03:36] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-03-06 12:03:36] [INFO] ALLOCATOR: Instance Test_install_4589 created.
[2024-03-06 12:04:16] [INFO] ALLOCATOR: Instance Test_install_4589 started.
[2024-03-06 12:04:19] [DEBUG] ALLOCATOR: Using provided credentials
[2024-03-06 12:04:19] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-03-06 12:04:22] [DEBUG] ALLOCATOR: Using provided credentials
[2024-03-06 12:04:22] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/inventory.yml
ansible_host: 192.168.57.2
ansible_password: None
ansible_port: 22
ansible_ssh_private_key_file: /home/cbordon/.ssh/allocation_test
ansible_user: vagrant
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
arch: amd64
host_identifier: None
host_instance_dir: None
identifier: Test_install_4589
instance_dir: /tmp/wazuh-qa/Test_install_4589
key_path: /home/cbordon/.ssh/allocation_test
platform: linux
provider: vagrant
ssh_port: 22
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -i /home/cbordon/.ssh/allocation_test vagrant@192.168.57.2
The authenticity of host '192.168.57.2 (192.168.57.2)' can't be established.
ED25519 key fingerprint is SHA256:WBTP58FUrAEHe7aI9NcTCyAQa5mIMeSnMq+yioIaYUw.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.57.2' (ED25519) to the list of known hosts.
vagrant@ubuntu1604:~$ exit
logout
Connection to 192.168.57.2 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ vagrant global-status
id       name    provider   state   directory                                                             
----------------------------------------------------------------------------------------------------------
ae3c0c6  default virtualbox running /tmp/wazuh-qa/VAGRANT-F698B2EA-464B-4E00-902B-B71BC61412FE            
bc3adf5  default virtualbox running /tmp/wazuh-qa/VAGRANT-A0BF0223-368F-4033-B1D6-09DAEEBEDCB0            
5106efe  default virtualbox running /tmp/windows-server-2022/VAGRANT-DE731BFF-83BF-4605-AC13-09B448F19E4C 
35cb6aa  default virtualbox running /tmp/windows-server-2022/VAGRANT-AC3597FD-A960-4599-AB8A-45E924CD407A 
9fcb3ad  default virtualbox running /tmp/wazuh-qa/Test_install_4589                                       

The above shows information about all known Vagrant environments
on this machine. This data is cached and may not be completely
up-to-date (use "vagrant global-status --prune" to prune invalid
entries). To interact with any of the machines, you can go to that
directory and run Vagrant, or you can use the ID directly with
Vagrant commands from any directory. For example:
"vagrant destroy 1a2b3c4d"
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/track.yml[2024-03-06 12:05:10] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-03-06 12:05:10] [DEBUG] ALLOCATOR: The key /home/cbordon/.ssh/allocation_test will not be deleted. It is the user's responsibility to delete it.
[2024-03-06 12:05:10] [DEBUG] ALLOCATOR: Destroying instance Test_install_4589
[2024-03-06 12:05:15] [INFO] ALLOCATOR: Instance Test_install_4589 deleted.

Screenshot_20240306_120500

c-bordon commented 2 months ago

Vagrant

macStadium with instance-name


cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.6-arm64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test --instance-name Test_install_4589
[2024-03-06 12:07:40] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-06 12:07:40] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-03-06 12:07:45] [INFO] ALLOCATOR: macStadium server has less than 2 VMs running, deploying in this host.
[2024-03-06 12:07:49] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-06 12:07:49] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-06 12:07:52] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-03-06 12:07:56] [INFO] ALLOCATOR: Instance Test_install_4589 created.
[2024-03-06 12:08:30] [INFO] ALLOCATOR: Instance Test_install_4589 started.
[2024-03-06 12:08:49] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-03-06 12:09:00] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/inventory.yml
ansible_host: 10.10.0.250
ansible_password: vagrant
ansible_port: 43220
ansible_ssh_private_key_file: None
ansible_user: vagrant
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
arch: arm64
host_identifier: macstadium
host_instance_dir: /Users/jenkins/testing/Test_install_4589
identifier: Test_install_4589
instance_dir: /tmp/wazuh-qa/Test_install_4589
key_path: /home/cbordon/.ssh/allocation_test
platform: macos
provider: vagrant
ssh_port: 43220
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -p 43220 vagrant@10.10.0.250
(vagrant@10.10.0.250) Password:
Last login: Wed Mar  6 07:08:17 2024
vagrant@macos-12 ~ % exit
Connection to 10.10.0.250 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/track.yml[2024-03-06 12:10:29] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-03-06 12:10:30] [DEBUG] ALLOCATOR: Destroying instance Test_install_4589
[2024-03-06 12:10:43] [DEBUG] ALLOCATOR: Deleting remote directory /Users/jenkins/testing/Test_install_4589
[2024-03-06 12:10:47] [DEBUG] ALLOCATOR: Killing remote process on port 43220
[2024-03-06 12:10:54] [INFO] ALLOCATOR: Instance Test_install_4589 deleted.

remote console

sh-3.2# ls -la testing
total 0
drwxr-xr-x   7 jenkins  staff   224 Mar  6 07:07 .
drwxr-x---+ 34 jenkins  staff  1088 Mar  6 04:09 ..
drwxr-xr-x   4 root     staff   128 Jan 15 04:56 689
drwxr-xr-x   4 jenkins  staff   128 Mar  6 07:08 Test_install_4589
drwxr-xr-x   4 root     staff   128 Sep  8 08:11 macos-testing
drwxr-xr-x   2 root     staff    64 Feb 21 05:17 testing_dir
drwxr-xr-x   4 root     staff   128 Aug 22  2023 wpk-testing
sh-3.2# prlctl list
UUID                                    STATUS       IP_ADDR         NAME
{7dd2c803-fa43-4466-b46f-9451d5695a78}  running      -               Test_install_4589
c-bordon commented 2 months ago

Vagrant

Black mini with instance-name

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-monterey-12.0.1-amd64 --provider vagrant --size micro --ssh-key ~/.ssh/allocation_test --instance-name Test_install_4589
[2024-03-06 12:12:50] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-06 12:12:50] [DEBUG] ALLOCATOR: Creating instance directory on remote host
[2024-03-06 12:13:04] [INFO] ALLOCATOR: Using the black mini server to deploy.
[2024-03-06 12:13:08] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-06 12:13:08] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-06 12:13:15] [DEBUG] ALLOCATOR: Vagrantfile created. Creating instance.
[2024-03-06 12:13:20] [INFO] ALLOCATOR: Instance Test_install_4589 created.
[2024-03-06 12:17:42] [ERROR] ALLOCATOR: Command failed: Sorry, don't know how to check guest version of Virtualbox Guest Additions on this platform. Stopping installation.

[2024-03-06 12:17:42] [INFO] ALLOCATOR: Instance Test_install_4589 started.
[2024-03-06 12:17:54] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-03-06 12:18:05] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/inventory.yml
ansible_host: 10.10.0.251
ansible_password: vagrant
ansible_port: 43220
ansible_ssh_private_key_file: None
ansible_user: vagrant
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
arch: amd64
host_identifier: black_mini
host_instance_dir: /Users/jenkins/testing/Test_install_4589
identifier: Test_install_4589
instance_dir: /tmp/wazuh-qa/Test_install_4589
key_path: /home/cbordon/.ssh/allocation_test
platform: macos
provider: vagrant
ssh_port: 43220
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -p 43220 vagrant@10.10.0.251
(vagrant@10.10.0.251) Password:
Last login: Wed Mar  6 16:17:41 2024
vagrant@MacBook-Pro ~ % exit
Connection to 10.10.0.251 closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider vagrant --action delete --track-output /tmp/wazuh-qa/track.yml[2024-03-06 12:19:30] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-03-06 12:19:31] [DEBUG] ALLOCATOR: Destroying instance Test_install_4589
[2024-03-06 12:19:47] [DEBUG] ALLOCATOR: Deleting remote directory /Users/jenkins/testing/Test_install_4589
[2024-03-06 12:19:51] [INFO] ALLOCATOR: Instance Test_install_4589 deleted.

Remote console

sh-3.2# ls -la
total 0
drwxr-xr-x   3 jenkins  staff    96 Mar  6 16:13 .
drwxr-xr-x@ 69 jenkins  staff  2208 Mar  6 16:13 ..
drwxr-xr-x   4 root     staff   128 Mar  6 16:13 Test_install_4589
sh-3.2# vagrant global-status
id       name    provider   state   directory                                
-----------------------------------------------------------------------------
5d442ae  default virtualbox running /Users/jenkins/testing/Test_install_4589 

The above shows information about all known Vagrant environments
on this machine. This data is cached and may not be completely
up-to-date (use "vagrant global-status --prune" to prune invalid
entries). To interact with any of the machines, you can go to that
directory and run Vagrant, or you can use the ID directly with
Vagrant commands from any directory. For example:
"vagrant destroy 1a2b3c4d"
c-bordon commented 2 months ago

AWS

Deploy of Linux machine

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name linux-ubuntu-22.04-amd64 --provider aws --size micro --ssh-key ~/.ssh/allocation_test --instance-name Test_install_4589 --label-issue https://github.com/wazuh/wazuh-qa/issues/4929 --label-team devops --label-termination-date "2024-03-06 21:00:00"
[2024-03-06 13:00:14] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-06 13:00:14] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-06 13:00:14] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-06 13:00:14] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-EB5E615E-B3F5-45DE-949C-88DC653F6E32
[2024-03-06 13:00:32] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-EB5E615E-B3F5-45DE-949C-88DC653F6E32 directory to /tmp/wazuh-qa/i-04055e60623e9fdf4
[2024-03-06 13:00:32] [INFO] ALLOCATOR: Instance i-04055e60623e9fdf4 created.
[2024-03-06 13:00:34] [INFO] ALLOCATOR: Instance i-04055e60623e9fdf4 started.
[2024-03-06 13:00:34] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-03-06 13:00:34] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/inventory.yml
ansible_host: ec2-34-231-171-150.compute-1.amazonaws.com
ansible_password: None
ansible_port: 22
ansible_ssh_private_key_file: /home/cbordon/.ssh/allocation_test
ansible_user: ubuntu
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -i /home/cbordon/.ssh/allocation_test ubuntu@ec2-34-231-171-150.compute-1.amazonaws.com
^C
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -i /home/cbordon/.ssh/allocation_test ubuntu@ec2-34-231-171-150.compute-1.amazonaws.com
The authenticity of host 'ec2-34-231-171-150.compute-1.amazonaws.com (34.231.171.150)' can't be established.
ED25519 key fingerprint is SHA256:7x9PWNXeu3BcZkj4Dbh5fU4FmKT9SMnypADlA20HsZE.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'ec2-34-231-171-150.compute-1.amazonaws.com' (ED25519) to the list of known hosts.
Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.19.0-1025-aws x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Wed Mar  6 16:01:37 UTC 2024

  System load:  0.28759765625     Processes:             107
  Usage of /:   20.6% of 7.57GB   Users logged in:       0
  Memory usage: 23%               IPv4 address for ens5: 172.31.14.116
  Swap usage:   0%

Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status

The list of available updates is more than a week old.
To check for new updates run: sudo apt update

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@ip-172-31-14-116:~$ exit
logout
Connection to ec2-34-231-171-150.compute-1.amazonaws.com closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider aws --action delete --track-output /tmp/wazuh-qa/track.yml[2024-03-06 13:01:43] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-03-06 13:03:01] [INFO] ALLOCATOR: Instance i-04055e60623e9fdf4 deleted.

Screenshot_20240306_130153

c-bordon commented 2 months ago

AWS

Deploy macOS

cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --composite-name macos-ventura-13.6.4-amd64 --provider aws --size micro --ssh-key ~/.ssh/allocation_test --label-issue https://github.com/wazuh/wazuh-qa/issues/4929 --label-team devops --label-termination-date "2024-03-06 21:00:00" --instance-name Test-Install-B835
[2024-03-06 13:48:32] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa
[2024-03-06 13:48:32] [DEBUG] ALLOCATOR: No config provided. Generating from payload
[2024-03-06 13:48:32] [DEBUG] ALLOCATOR: Using provided key pair
[2024-03-06 13:48:33] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-584D94F5-5A57-489C-A96E-0218BCC023BB
[2024-03-06 13:48:51] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-584D94F5-5A57-489C-A96E-0218BCC023BB directory to /tmp/wazuh-qa/i-03a64b04840ff5b08
[2024-03-06 13:48:51] [INFO] ALLOCATOR: Instance i-03a64b04840ff5b08 created.
[2024-03-06 13:48:52] [INFO] ALLOCATOR: Instance i-03a64b04840ff5b08 started.
[2024-03-06 13:48:52] [INFO] ALLOCATOR: Inventory file generated at /tmp/wazuh-qa/inventory.yml
[2024-03-06 13:48:52] [INFO] ALLOCATOR: Track file generated at /tmp/wazuh-qa/track.yml
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/inventory.yml
ansible_host: ec2-54-221-103-239.compute-1.amazonaws.com
ansible_password: None
ansible_port: 22
ansible_ssh_private_key_file: /home/cbordon/.ssh/allocation_test
ansible_user: ec2-user
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ cat /tmp/wazuh-qa/track.yml
arch: amd64
host_identifier: h-063f33be1f52efbe9
host_instance_dir: None
identifier: i-03a64b04840ff5b08
instance_dir: /tmp/wazuh-qa/i-03a64b04840ff5b08
key_path: /home/cbordon/.ssh/allocation_test
platform: macos
provider: aws
ssh_port: 22
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -i /home/cbordon/.ssh/allocation_test ec2-user@ec2-54-221-103-239.compute-1.amazonaws.com
ssh: connect to host ec2-54-221-103-239.compute-1.amazonaws.com port 22: Connection timed out
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ ssh -i /home/cbordon/.ssh/allocation_test ec2-user@ec2-54-221-103-239.compute-1.amazonaws.com
The authenticity of host 'ec2-54-221-103-239.compute-1.amazonaws.com (54.221.103.239)' can't be established.
ED25519 key fingerprint is SHA256:0TxrpJbpR4l+dQvtrZU+A59bexWu6wPIeFh5LAfd1mE.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'ec2-54-221-103-239.compute-1.amazonaws.com' (ED25519) to the list of known hosts.

    ┌───┬──┐   __|  __|_  )
    │ ╷╭╯╷ │   _|  (     /
    │  └╮  │  ___|\___|___|
    │ ╰─┼╯ │  Amazon EC2
    └───┴──┘  macOS Ventura 13.6.4

ec2-user@ip-172-31-29-152 ~ % sw_vers
ProductName:            macOS
ProductVersion:         13.6.4
BuildVersion:           22G513
ec2-user@ip-172-31-29-152 ~ % exit
Connection to ec2-54-221-103-239.compute-1.amazonaws.com closed.
cbordon@cbordon-MS-7C88:~/Documents/wazuh/repositorios/wazuh-qa/deployability$ python3 launchers/allocation.py --provider aws --action delete --track-output /tmp/wazuh-qa/track.yml[2024-03-06 13:54:03] [INFO] ALLOCATOR: Deleting instance from trackfile /tmp/wazuh-qa/track.yml
[2024-03-06 14:02:31] [INFO] ALLOCATOR: Releasing dedicated host: h-063f33be1f52efbe9
[2024-03-06 14:02:32] [INFO] ALLOCATOR: Dedicated host 'h-063f33be1f52efbe9' cannot be released as it is occupied.
[2024-03-06 14:02:32] [INFO] ALLOCATOR: Instance i-03a64b04840ff5b08 deleted.

Screenshot_20240306_134937

fcaffieri commented 2 months ago

LGTM We need to develop automated unit test to ensure that the changes that are implemented do not impact the OS listing

QU3B1M commented 2 months ago

LGTM!