Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running L3AFD on Azure VMs #38

Closed
t-cindywan opened this issue Jun 9, 2022 · 6 comments
Closed

Running L3AFD on Azure VMs #38

t-cindywan opened this issue Jun 9, 2022 · 6 comments

Comments

@t-cindywan
Copy link

What I did:

  1. Edited config.yaml and copied everything from dev_environment into /vagrant
  2. Ran commands in Vagrantfile
  3. Ran commands in provision.sh
  4. Ran commands in start_test_servers.sh
  5. Noticed 2 servers started on port 8080 and port 8081
  6. Ran hey -n 200 -c 20 http://localhost:18080 command
  7. Received following error message:
    Error distribution:
    [200] Get "http://localhost:18080": dial tcp 127.0.0.1:18080: connect: connection refused

Issues:
Due to the above error message, where is the server 18080 coming from and how do I start it?

I saw that in config.yaml, there is a port 18080. Then, I saw that config.yaml is referenced in the Vagrantfile, where I found that the cfg variable, which is joined to config.yaml, is referenced in the following line of code:
config.vm.synced_folder cfg['host_l3afd_code_dir'], "/home/vagrant/code/l3afd"
The above directory does not exist because I am not using a Vagrant VM, I am using an Azure VM.
How should I proceed?

In the instruction "On the VM, go to ~/code/l3afd and run go install ." the ~/code/l3afd directory does not exist because I am using an Azure VM. Additionally, in the instruction "On the VM, go to ~/go/bin and run l3afd as root: sudo ./l3afd --config /vagrant/cfg/l3afd.cfg", the ~/go/bin directory also does not exist.

@t-cindywan t-cindywan changed the title Running l3afd on Azure VMs Running L3AFD on Azure VMs Jun 9, 2022
@dahavey
Copy link

dahavey commented Jun 14, 2022

@sanfern do you know the answer to the above question?

@sanfern
Copy link
Contributor

sanfern commented Jun 15, 2022

Replace port 18080 with 8080, since in vagrant port forwarding rules have been enabled. In this case, we are in the same virtual machine. There is no need for port forwarding, we should use the same port as specified in the vagrant file.

Are you successful in running go build or go install, if not please install go.

@t-cindywan
Copy link
Author

@sanfern Hi Santhosh, I just tried running the go install . command but was unable to find ~/go/bin in the directory. Is this the wrong command? How should I proceed?

@sanfern
Copy link
Contributor

sanfern commented Jun 16, 2022

Can you execute go build in l3afd directory and check l3afd binary is created. Then execute ./l3afd --config <l3afd.cfg file with path>

@t-cindywan
Copy link
Author

t-cindywan commented Jun 16, 2022

@sanfern I was able to find ~/go/bin in the directory. However, after continuing with the installation process, I ran the sudo ./l3afd --config /vagrant/cfg/l3afd.cfg command and received the following errors:
2022-06-16T22:49:28Z INF Reading configuration from: /vagrant/cfg/l3afd.cfg
2022-06-16T22:49:28Z INF Using default value TLS_1.3 after failure to read group:mTLS; field:min-tls-version error="option not found: min-tls-version"
2022-06-16T22:49:28Z INF Using default value /etc/l3afd/certs after failure to read gro up:mtls; field:cert-dir error="option not found: cert-dir"
2022-06-16T22:49:28Z INF Using default value ca.pem after failure to read group:mtls; f ield:cacert-filename error="option not found: cacert-filename"
2022-06-16T22:49:28Z INF Using default value server.crt after failure to read group:mtl s; field:server-cert-filename error="option not found: server-cert-filename"
2022-06-16T22:49:28Z INF Using default value server.key after failure to read group:mtl s; field:server-key-filename error="option not found: server-key-filename"
2022-06-16T22:49:28Z INF Checking for another already running instance (using PID file "./l3afd.pid")...
2022-06-16T22:49:28Z INF Found PID file with PID: 4065; checking if it is this process: PID: 5268
2022-06-16T22:49:28Z INF Found PID file with PID: 4065; checking if process is running. ..
2022-06-16T22:49:28Z INF Process was not running, removing PID file.
2022-06-16T22:49:28Z INF Writing process ID 5268 to ./l3afd.pid...
2022-06-16T22:49:28Z WRN Implement custom registration with management server
2022-06-16T22:49:28Z INF l3afd config server setup started on host cw-l3afd
2022-06-16T22:49:28Z WRN no persistent config exists

Additionally, after I ran curl -X POST http://localhost:37080/l3af/configs/v1/update -d "@cfg/payload.json", I also received these following errors:
t-cindywan@cw-l3afd: $ curl -X POST http://localhost:7080/l3af/configs/v1/update -d "@cfg/payload.json"
Warning: Couldn't read data from file "cfg/payload.json", this makes an empty
Warning: POST.
failed to unmarshal payload: unexpected end of JSON inputt-cindywan@cw-l3afd:

How do I resolve both of these errors?

@jniesz
Copy link
Contributor

jniesz commented Nov 3, 2022

Provisioning on Linux VMs is supported
PR #44 addresses this

@jniesz jniesz closed this as completed Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants