pry0cc / axiom

The dynamic infrastructure framework for everybody! Distribute the workload of many different scanning tools with ease, including nmap, ffuf, masscan, nuclei, meg and many more!
MIT License
4.06k stars 645 forks source link

DO not auto transferring image to new region #580

Open random-robbie opened 2 years ago

random-robbie commented 2 years ago

Hey,

Weird one my token works but when i go to build a fleet i can not see them in my account.

is there a log i can review to work out whats going wrong? i'm seeing no errors on the cli so far.

u@u:~$ axiom-fleet -i 4 -r ams3
Initializing new fleet 'noyce' with 4 instances...
Cycling through following regions:ams3...
INITIALIZING IN 5 SECONDS, CTRL+C to quit...
Instances: [ noyce01 noyce02 noyce03 noyce04  ]
Initialized instance 'noyce01' at ''!ization...
Initialized instance 'noyce02' at ''!ization...
Initialized instance 'noyce03' at ''!ization...
Initialized instance 'noyce04' at ''!ization...
Selected: [  ]o fleet noyce initialization...
Fleet started succesfully!

The Box's below are just my normal boxs not the fleet.

u@u:~$ axiom-ls
Listing instances in account: personal
Instance                 Primary Ip      Backend Ip      Region  Size         Status  $/M
bb2.xxx  10.136.244.148  1xxxxxxx  nyc1    s-1vcpu-2gb  active  12
bb3.xxx  10.136.244.150  1xxxxx  nyc1    s-1vcpu-2gb  active  12
_                        _               _               _       _            Total   $24

u@u:~/.axiom$ cat stats.log

"init":"noyce01","ip":"","time":"2022-08-09-TIME-18:50:55","region":"ams3","size":"s-1vcpu-1gb","image":"axiom-default-1660067518","deploy":"false"}
{"init":"noyce02","ip":"","time":"2022-08-09-TIME-18:50:59","region":"ams3","size":"s-1vcpu-1gb","image":"axiom-default-1660067518","deploy":"false"}
{"init":"noyce03","ip":"","time":"2022-08-09-TIME-18:51:03","region":"ams3","size":"s-1vcpu-1gb","image":"axiom-default-1660067518","deploy":"false"}
{"init":"noyce04","ip":"","time":"2022-08-09-TIME-18:51:07","region":"ams3","size":"s-1vcpu-1gb","image":"axiom-default-1660067518","deploy":"false"}
0xtavian commented 2 years ago

@random-robbie Try running axiom-fleet with the --debug flag. Also what OS did you install the axiom controller on? Try to use an Ubuntu 20.04 droplet or any OS in our supported OS. There are a few issues with [Interlace] (https://github.com/codingo/Interlace/issues/163 ) using the latest version of python ( python 10 and 9 might have issues IIRC).

0xtavian commented 2 years ago

Also, make sure you are spinning up the fleet in the same region you built the image in. DO doesnt automatically transfer images to new regions just because its requested in that region. you'll need to transfer it via the doctl cli if you want to spinup in multiple regions. It should show an error but I just tested and there is no error when you spin up in a different region ( i'll look in it ). You can manage your images via axiom-images. Thanks for catching that missing error ( if that is the case). @random-robbie

random-robbie commented 2 years ago

ah that might be why as i've tried to build in am3 with the image living in lon1.

Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-121-generic x86_64) OS Python 3.8.10 Python Version.

i'll rebuild and try again :)

0xtavian commented 2 years ago

After you verify thats the issue, if u r using DO and want to check out round robin region distribution, this is only specific to DO, all other cloud providers auto transfer the image.

First get the imageid from axiom-images ls, then run for i in $(axiom-region ls | grep -v false | grep -v Slug | cut -d ' ' -f 1); do doctl compute image-action transfer [imageid-here] --region $i --wait ; done

After the image is transferred to each region. then you can use -r/--regions and specify all regions in a comma separated list.

You dont need to rebuild, you can just run axiom-fleet -i 4. If you already started to rebuild ( via running axiom-build), but want to see if your first image works in lon1, run axiom-images ls and get the image name thats in lon1, then run axiom-images set $image-name. Once you set the old image, you should just be able to run axiom-fleet -i 4 without the region and it will default to the correct region. Keep in mind you'll have to switch it back if you want to use the second image build. @random-robbie

random-robbie commented 2 years ago

Cheers dude,re testing now.

fail-open commented 2 years ago

Sorry if it was mentioned and i missed it skimming. the at ''!ization... you are seeing is an error message that the box is failing from the provider which would be why you dont see it in the cloud dashboard. Obviously that doesnt help in figuring out why the errors (I assume the debug command will help there), but if it wasnt clear why they werent showing up, thats why, or what you can look for to spot issues.