hyperkit icon indicating copy to clipboard operation
hyperkit copied to clipboard

create_container() returns 400

Open egeexyz opened this issue 7 years ago • 1 comments

The code from the documentation shows:

lxd = Hyperkit::Client.new(api_endpoint: "https://lxd.example.com", verify_ssl: false)

# Create a new container and start it
lxd.create_container("test-container", alias: "ubuntu/trusty/amd64")
lxd.start_container("test-container")

Assuming that we're running this locally on 127.0.0.1...

The lxd.create_container("test-container", alias: "ubuntu/trusty/amd64") returns the following error: error: POST https://127.0.0.1:8443/1.0/containers: 404 - Error: not found. Use --trace to view backtrace

I've tested other functions such as copy_container, delete_container, stop_container and they all work fine. Only create_container fails with this error.

egeexyz avatar Feb 10 '19 08:02 egeexyz

I don't know anyone is still having this issue, however to create_container from images.linuxcontainers.org the code bellow worked for me.

Hyperkit.create_container("test-container00",
  type: "image",
  alias: "ubuntu/trusty/amd64",
  server: "https://images.linuxcontainers.org",
  protocol: "simplestreams",
  mode: "pull"
)

Running lxc init images:centos/7/cloud test01--debug will dump all the params being sent to the api.

freedomfury avatar Feb 13 '20 02:02 freedomfury