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
3.92k stars 615 forks source link

Problem with azure fleet in multiple regions #750

Open devofstuff opened 9 months ago

devofstuff commented 9 months ago

I create my azure account and do axiom-build and axiom-init just fine. I can also start a fleet in the local region just fine. I cannot, however, create a fleet with --regions because it fails with an error saying the image can not be found in the region. I am using reconftw as the image and axiom-images shows the image with a ProvisioningState of Succeeded. I have Linode and Digital Ocean working successfully, but azure does not work. What am I doing wrong? Thanks for a really cool tool.

0xtavian commented 9 months ago

Hey @devofstuff yea not all cloud providers support automatic image transferring to a new region. Linode does, so we didn’t need to add code to transfer the image. DO for example doesn’t so we’ve added code to transfer the image to the region if it’s requested in a region yet doesn’t exist. Seems like we have to do the same for azure. In the meantime you should be able to manually transfer the azure image to a new region using the az cli. I’ll look into adding some code that transfers the images automatically for azure. We’ll keep this issue open for anyone else running into the same issue. ty for reporting :)

devofstuff commented 9 months ago

I tried using the cli to copy the image to other regions using the following command:

az image copy --source-resource-group axiom --source-object-name axiom-reconftw-1694982488 --target-location southafricawest --target-resource-group "axiom" --cleanup

I get the following error

Getting OS disk ID of the source VM/image command failed: ['/usr/bin/../../opt/az/bin/python3', '-m', 'azure.cli', 'disk', 'show', '--ids', '/subscriptions/6xxxx-xxxx-xxx-x-xxxxxxx/resourceGroups/axiom/providers/Microsoft.Compute/disks/pkrosztgl2himwz', '--output', 'tsv'] output: ERROR: (ResourceNotFound) The Resource 'Microsoft.Compute/disks/pkrosztgl2himwz' under resource group 'axiom' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix Code: ResourceNotFound Message: The Resource 'Microsoft.Compute/disks/pkrosztgl2himwz' under resource group 'axiom' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

Unable to find the source OS disk. Please make sure the source OS disk is not deleted. If you deleted the source disk where the image was created (or chose to delete the VM while creating the image). Please refer to https://github.com/Azure/azure-cli/issues/25431 for temporary solution.

Have you or any others here ever got this to work? Thanks for all the help!