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

Having Problem in VM Setup. #18

Closed
nitinya9av opened this issue Nov 21, 2022 · 16 comments
Closed

Having Problem in VM Setup. #18

nitinya9av opened this issue Nov 21, 2022 · 16 comments
Assignees
Labels
question Information requested from user

Comments

@nitinya9av
Copy link

I am trying to set up VM for farmvibes.ai with docker on Microsoft azure but don,t understand the setup guide.
What does this point mean? (in the picture below)
Screenshot (173)
my terminal shows this error
Screenshot (174)

@brsilvarec
Copy link
Contributor

Hi there @nitinya9av,

Thanks for sharing this. I believe you need to create the SSH public key. As stated in the documentation you need to create it using the ssh-keygen command and use the default options. Please, see the following figure that shows how to proceed. After creating the public key and logging into azure, you should be able to create the VM.

image

@brsilvarec
Copy link
Contributor

Please, be advised this will create a SSH key that will be only accessible while you have the container is running. If you loose the container your will have no way to connect to your VM.

I recommend you use a more stable platform like a Linux machine (WSL can be an option) to create the FarmVibes.AI vm.

@lonnes lonnes reopened this Nov 21, 2022
@brsilvarec
Copy link
Contributor

brsilvarec commented Nov 21, 2022

You also need to clone the repository and execute the azure deployment command inside the farmvibes-ai folder.

image

My Recommendation is to do the following.

  1. Use a more stable Linux environment to deploy the FarmVibes.AI VM.
  2. Once you create/access this environment, issue the ssh-keygen command.
  3. Clone the repository and enter the folder.
  4. Log into the azure cli using a valid subscription.
  5. Create the VM using the command you pasted..

Please, let me know if this worked for you.

@brsilvarec brsilvarec self-assigned this Nov 21, 2022
@brsilvarec brsilvarec added the question Information requested from user label Nov 21, 2022
@brsilvarec
Copy link
Contributor

If you really want to use a container to create the VM, you can use a volume to persist the SSH key in your windows host. In the following example, I created a folder that will persist the ssh keys (C:\Users\brunosilva\Documents\ssh). Please, replace this folder with a valid folder in your system.

image

This command created the container, generated the SSH key, and killed the container.

Observe when I created the container again, my SSH public key was there. Without the volume, the SSH public key would not be there.

@nitinya9av
Copy link
Author

I am using WSL Ubuntu 20.04(as you recommended) but while running this volume command get an error.
Screenshot (176)

@brsilvarec
Copy link
Contributor

brsilvarec commented Nov 23, 2022

Hi @nitinya9av,

If your running on WSL, there is no need to add the volume or even create the container. Container + volume creation is only required if you are using a windows machine.

Please try consider installing azure cli on your Ubuntu WSL, this command curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash should do the job. After doing that, proceed as explained here.

#18 (comment)

Please let me know if this worked or not ... I am glad to help

@nitinya9av
Copy link
Author

nitinya9av commented Nov 23, 2022

Now, I am using WSL ubuntu 20.04 (without the docker container) as you recommend and after following 4 steps that you mentioned

My Recommendation is to do the following.

  1. Use a more stable Linux environment to deploy the FarmVibes.AI VM.
  2. Once you create/access this environment, issue the ssh-keygen command.
  3. Clone the repository and enter the folder.
  4. Log into the azure cli using a valid subscription.
  5. Create the VM using the command you pasted.

but at step 5 I am getting this

Screenshot (178)

@brsilvarec
Copy link
Contributor

Thanks for your quick response.

It seems your bicep was not installed properly. Can you run this command?

az bicep upgrade

If this does not work, please consider reinstalling azure cli.

@nitinya9av
Copy link
Author

nitinya9av commented Nov 23, 2022

Hi @brsilvarec
First I run az bicep upgrade command and get this
Screenshot (179)
then I reinstall azure cli with both methods and get the same error.

@brsilvarec
Copy link
Contributor

It seems there is something wrong with your azure cli installation. This kind of error usually happens when we try to execute some software in a wrong platform.

According to your terminal screenshot you are using Ubuntu, then this should be the platform
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt

image

My recommendation is to uninstall the azure cli at the end of pointed page and try again.

This is the expected behavior for a successful azure cli installation.

╰─➤  az bicep --help                                                                                                             2 ↵

Group
    az bicep : Bicep CLI command group.

Commands:
    build         : Build a Bicep file.
    decompile     : Attempt to decompile an ARM template file to a Bicep file.
    install       : Install Bicep CLI.
    list-versions : List out all available versions of Bicep CLI.
    publish       : Publish a bicep file to a remote module registry.
    uninstall     : Uninstall Bicep CLI.
    upgrade       : Upgrade Bicep CLI to the latest version.
    version       : Show the installed version of Bicep CLI.

To search AI knowledge base for examples, use: az find "az bicep"

You have 3 updates available. Consider updating your CLI installation with 'az upgrade'

Please let us know how we are doing: https://aka.ms/azureclihats

@brsilvarec
Copy link
Contributor

Please, also consider taking a looking at this troubleshooting page related to Azure CLI on WSL. https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#cli-fails-to-install-or-run-on-windows-subsystem-for-linux

@nitinya9av
Copy link
Author

The Above problem is solved by first uninstalling bicep using the command az bicep uninstall and then reinstalling it.
but now, I have a new error in my azure quota I have an azure for student subscription which only allows 6 vCPUs is there any way that I can run farmvibes.ai on 6 vCPUs instead of 8 vCPUs?

Screenshot (180)

@brsilvarec
Copy link
Contributor

brsilvarec commented Nov 24, 2022

You can use the parameter vm_size after encoded_script. I selected a Standard_DC4s_v3 but you can try another instance.

az deployment group create --resource-group <resource_group> \
  --name <deployment_name> \
  --template-file  resources/vm/farmvibes_ai_vm.bicep \
  --parameters \
           ssh_public_key="$(cat ~/.ssh/id_rsa.pub)" \
           vm_suffix_name=<my_test_suffix> \
           encoded_script="$(cat resources/vm/setup_farmvibes_ai_vm.sh | gzip -9 | base64 -w0)" \
           vm_size=Standard_DC4s_v3

@brsilvarec
Copy link
Contributor

BTW, you can check out tutorial video showing how to set up the parameters for the FarmVibes.AI VM.

https://youtu.be/RNoA7ri2v5I?t=1811

@nitinya9av
Copy link
Author

nitinya9av commented Nov 25, 2022

Thanks!! @brsilvarec
For all Azure student subscription holders, you have the option to utilize the vm_size parameter to vm_size=Standard_DS3_v2 .
VM setup is successful.
👌👍

@brsilvarec
Copy link
Contributor

brsilvarec commented Nov 25, 2022

Thanks @nitinya9av

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Information requested from user
Projects
None yet
Development

No branches or pull requests

3 participants