How to map disk to gues tlinux scsi device using API?

Hi,

I am trying to use Linode API to assign disk to Linux SCSI device inside guest. I looked at Disk and VOlume API and thought only config

POST is the way to work, but I m running into issues with query.

I have create new disk called datadisk and i want the datadisk to be mapped to /dev/sdb on the guest. It works on UI Profile Configuration menu, but does not work with POST

request below.

Can you tell me what is th problem with below query?

curl -H "Content-Type: application/json" -H "Authorization: Bearer " -X PUT -d '{ "disks":{"sdb": {"id": 9673233 } } }' https://api.linode.com/v4/linode/instan … /470778494">https://api.linode.com/v4/linode/instances/3544343483/configs/470778494

{"kernel": "linode/latest-64bit", "label": "Ubu16-img", "helpers": {"distro": true, "modulesdep": true, "network": true, "updatedbdisabled": true, "devtmpfsautomount": true}, "memorylimit": 0, "rootdevicero": true, "virtmode": "paravirt", "runlevel": "default", "id": 4708494, "created": "2017-08-18T15:10:30", "comments": "", "devices": {"sdd": {"diskid": 9104705, "volumeid": null}, "sda": {"diskid": 9104704, "volumeid": null}, "sde": null, "sdg": null, "sdf": null, "sdc": null, "sdb": null, "sdh": null}, "root_device": "/dev/sda", "initrd": null, "updated": "2017-08-18T15:10:30"}

#

curl --verbose -H "Content-Type: application/json" -H "Authorization: Bearer " -X PUT -d '{ "disks":{"sdb": {"id": 9673233 } } }' https://api.linode.com/v4/linode/instan … 7434308494">https://api.linode.com/v4/linode/instances/35483434383/configs/47434308494

  • About to connect() to api.linode.com port 443 (#0)

  • Trying 72.156.191.203… connected

  • Connected to api.linode.com (72.156.191.203) port 443 (#0)

  • Initializing NSS with certpath: sql:/etc/pki/nssdb

  • CAfile: /etc/pki/tls/certs/ca-bundle.crt

CApath: none

  • SSL connection using TLSECDHERSAWITHAES128GCM_SHA256

  • Server certificate:

  • subject: CN=*.linode.com

  • start date: Aug 04 00:00:00 2017 GMT

  • expire date: Sep 02 23:59:59 2019 GMT

  • common name: *.linode.com

  • issuer: CN=RapidSSL SHA256 CA,O=GeoTrust Inc.,C=US

PUT /v4/linode/instances/35453434383/configs/4743408494 HTTP/1.1

User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2

Host: api.linode.com

Accept: /

Content-Type: application/json

Authorization: Bearer > Content-Length: 38

>

< HTTP/1.1 200 OK

< Server: nginx

< Date: Mon, 25 Sep 2017 19:05:56 GMT

< Content-Type: application/json

< Content-Length: 608

< Connection: keep-alive

< X-OAuth-Scopes: linodes:delete,domains:delete,nodebalancers:delete,images:delete,stackscripts:delete,longview:delete,events:delete,tokens:delete,clients:delete,account:delete,users:delete,tickets:delete,ips:delete,volumes:delete

< X-Accepted-OAuth-Scopes: linodes:modify

< X-Frame-Options: DENY

< Access-Control-Allow-Origin: *

< Access-Control-Allow-Methods: HEAD, GET, OPTIONS, POST, PUT, DELETE

< Access-Control-Allow-Headers: Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter

< X-RateLimit-Limit: 10

< X-RateLimit-Remaining: 9

< X-RateLimit-Reset: 1506366357

< Retry-After: 0

< Access-Control-Allow-Credentials: true

< Access-Control-Expose-Headers: X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status

< Cache-Control: private, max-age=60, s-maxage=60

< Content-Security-Policy: default-src 'none'

< Vary: Authorization, X-Filter

< X-Content-Type-Options: nosniff

< X-Content-Type-Options: nosniff

< X-Frame-Options: DENY

< X-XSS-Protection: 1; mode=block

< Strict-Transport-Security: max-age=31536000

<

  • Connection #0 to host api.linode.com left intact

  • Closing connection #0

{"memorylimit": 0, "helpers": {"distro": true, "network": true, "modulesdep": true, "updatedbdisabled": true, "devtmpfsautomount": true}, "initrd": null, "rootdevice": "/dev/sda", "created": "2017-08-18T15:10:30", "rootdevicero": true, "virtmode": "paravirt", "runlevel": "default", "updated": "2017-08-18T15:10:30", "comments": "", "kernel": "linode/latest-64bit", "label": "Ubu16-img", "devices": {"sdb": null, "sdd": {"diskid": 9104705, "volumeid": null}, "sdg": null, "sdh": null, "sdc": null, "sda": {"diskid": 9104704, "volume_id": null}, "sdf": null, "sde": null}, "id": 4708494}

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct