threefoldtech / terraform-provider-grid

Apache License 2.0
8 stars 5 forks source link

QSFS example need to be updated #948

Open A-Harby opened 3 weeks ago

A-Harby commented 3 weeks ago

Terraform Version

Terraform v1.0.7 on linux_amd64

Affected Resource(s)

Description

First error: I got this error

╷
│ Error: Unsupported attribute
│ 
│   on main.tf line 117, in output "ygg_ip":
│  117:   value = grid_deployment.qsfs.vms[0].ygg_ip
│ 
│ This object has no argument, nested block, or exported attribute named "ygg_ip".

I think name is changed to planetary_ip, not sure.

Second error: I got error from scheduler

│ Error: couldn't deploy deployment with error: node 150 does not have enough resources. needed: [mru: 0, sru: 0, hru: 85899345920], free: [mru: 2252460851, sru: 1676689195008, hru: 0]
│ 
│   with grid_deployment.d1,
│   on main.tf line 33, in resource "grid_deployment" "d1":
│   33: resource "grid_deployment" "d1" {

and the code use to set filter is

resource "grid_scheduler" "sched" {
  requests {
    name = "node1"
    cru  = 2
    sru  = 1024 * 10 * 8
    mru  = 1024
  }
}

It should be updated to hru instead of sru probably, I tried but still got the same error.

Mik-TF commented 3 weeks ago

"I think name is changed to planetary_ip, not sure."

Yes exactly. It changed from ygg to planetary.

So with hru instead of mru, did it work? Or did you got it to work in any way? Thanks

A-Harby commented 3 weeks ago

So with hru instead of mru, did it work? Or did you got it to work in any way? Thanks

I had to manually select the node instead of scheduler, so I changed this line to node = 159 (working node on devnet with free resource enough) and it worked with me, but this shouldn't be the correct way to do it. I wanted to make sure that the script is still running correctly.

And for the Ygg, I just printed the whole vm details; the output was

Outputs:

metrics = "http://[302:b94d:f7ea:d753:4bb9:1e41:da43:755f]:9100/metrics"
ygg_ip = {
  "computedip" = ""
  "computedip6" = ""
  "console_url" = "10.1.2.1:20002"
  "corex" = false
  "cpu" = 2
  "description" = ""
  "entrypoint" = "/sbin/zinit init"
  "env_vars" = tomap({
    "SSH_KEY" = <<-EOT
    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCvmSYj5BKWkizdNyIziMfMm0CRrgq0UxFtBfBdArUMXSFkU30rtExbg6dlVFJCufw6UsCESm/QBSwlOyYKRdpsfVARcAw5G5OG0iX/22n+tYmCcWpmOJLJZaAmSynF1kwpBx3XDy40mFL6OMXjqFcU3DirbcucIL185XfAsTzrq3tDtSvmYPwbXMVMbs1ZAZValxOQNuaLty4qGD2awxVNZq4vtAzgpz3FFo3cs2g70jsGiPq/rsH+NxZHYmqvYnF/S0aPGBrbOe2yW8Cz0mqq5CzqbjYd+Qorkmt7uyJrlCBI43ky+pUuiAYeE1eJlWl5svA+ibWk5yYoa6svLUkaL1kcOMeZWLzDjL3OCrno9gglNp8zUkdSagHROoYlGgpc5fnzMGX4MKDLpHdE9xdk4NjpjB2Iq3hV3DamexXAhLEirLYv9fSilSyKVf/2kvYAa9o+NS4DgBVvXg9J54By/mAVsydD4lbpNe/2pX/WoFGCczmoQfWdHgJPYVCf2vU= harby@ahmed-Saleh-Harby

    EOT
  })
  "flist" = "https://hub.grid.tf/tf-official-apps/base:latest.flist"
  "flist_checksum" = ""
  "gpus" = tolist(null) /* of string */
  "ip" = "10.1.2.2"
  "memory" = 1024
  "mounts" = tolist([
    {
      "disk_name" = "qsfs"
      "mount_point" = "/qsfs"
    },
  ])
  "mycelium_ip" = ""
  "mycelium_ip_seed" = ""
  "name" = "vm"
  "planetary" = true
  "planetary_ip" = "302:b94d:f7ea:d753:ab10:3916:e29f:b144"
  "publicip" = false
  "publicip6" = false
  "rootfs_size" = 0
  "zlogs" = tolist(null) /* of string */
}