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

CLI server update disk issue #95

Open
gavin-lai opened this issue Dec 23, 2016 · 4 comments
Open

CLI server update disk issue #95

gavin-lai opened this issue Dec 23, 2016 · 4 comments

Comments

@gavin-lai
Copy link

gavin-lai commented Dec 23, 2016

Hi CLI team,
A support ticket (
https://t3n.zendesk.com/agent/tickets/1340287) came in, when running with 2016-11-24 binary
clc version:
CenturyLink Cloud CLI (Version v1.1.0)
https://github.com/CenturyLinkCloud/clc-go-cli
Go Version: go1.7.1 windows/amd64
Built on: 2016-11-24_01:48:24pm
Git Commit: 489cade

#69 supposed to fix a similar issue.
PS C:\clc> .\clc.exe server update '{"ServerId": "va1pmta00000003","Disks" : {"Keep" : [{ "Id": "0:0", "SizeGB": 1},{ "Id": "0:1", "SizeGB": 2},{
"Id": "0:2", "SizeGB": 22}]}}'

{ServerId: va1pmta00000003,Disks : {Keep : [{ Id: 0:0, SizeGB: 1},{ Id: 0:1, SizeGB: 2},{ Id: 0:2, SizeGB: 22}]}} is neither a valid JSON object nor a valid object in a=b,c=d.. format.
PS C:\clc>
Still having error.
Any insight would be great.
Thanks
Gavin

@casrep
Copy link

casrep commented Dec 28, 2016

I have a similar issue. Could the README and the tool's help text be updated to clarify what the accepted structure is as well?

To be clear - the server has 3 disks, and I'm trying delete 0:2. Here's the commands and results I ran:

$ clc server update --server-name SERVERNAME --disks 0:0,0:1
`0:0,0:1` must be an object specified either in JSON or in key=value,.. format

$ clc server update --server-name SERVERNAME --disks diskId=0:0,diskId=0:1
Unknown option or argument: `DiskId`.

$ clc server update --server-name SERVERNAME --disks id=0:0,id=0:1
Unknown option or argument: `Id`.

$ clc server update --server-name SERVERNAME --disks "id=0:0,id=0:1"
Unknown option or argument: `Id`.

@antonsoroko
Copy link

@gavin-lai Hi. You need to use DiskId instead of Id:
(as described here - #69 (comment))

$ clc server update '{"ServerId": "VA2RUCKTESTGO01","Disks" : {"Keep" : [{ "DiskId": "0:0", "SizeGB": 1},{ "DiskId": "0:1", "SizeGB": 2},{ "DiskId": "0:2", "SizeGB": 14},{ "DiskId": "0:3", "SizeGB": 5},{ "DiskId": "0:4", "SizeGB": 5}]}}'
{
    "Href": "/v2/operations/ruck/status/va2-27418",
    "Id": "va2-27418",
    "Name": "",
    "Rel": "status",
    "Verbs": null
}

@casrep Hi. You need to use JSON, like this
(more info about format and why you should specify SizeGB - #69 (comment))

$ clc server update '{"ServerId": "VA2RUCKTESTGO01","Disks" : {"Keep" : [{ "DiskId": "0:0", "SizeGB": 1},{ "DiskId": "0:1", "SizeGB": 2},{ "DiskId": "0:2", "SizeGB": 14},{ "DiskId": "0:3", "SizeGB": 8},{ "DiskId": "0:4", "SizeGB": 15}]}}'
{
    "Href": "/v2/operations/ruck/status/va2-27419",
    "Id": "va2-27419",
    "Name": "",
    "Rel": "status",
    "Verbs": null
}

So, I got this info from clc server list before these operations:

            "Disks": [
                {
                    "Id": "0:0",
                    "PartitionPaths": [],
                    "SizeGB": 1
                },
                {
                    "Id": "0:1",
                    "PartitionPaths": [],
                    "SizeGB": 2
                },
                {
                    "Id": "0:2",
                    "PartitionPaths": [],
                    "SizeGB": 14
                },
                {
                    "Id": "0:3",
                    "PartitionPaths": [],
                    "SizeGB": 5
                },
                {
                    "Id": "0:4",
                    "PartitionPaths": [],
                    "SizeGB": 5
                },
                {
                    "Id": "0:5",
                    "PartitionPaths": [],
                    "SizeGB": 5
                }
            ],

And after these two operations I got

            "Disks": [
                {
                    "Id": "0:0",
                    "PartitionPaths": [],
                    "SizeGB": 1
                },
                {
                    "PartitionPaths": [],
                    "SizeGB": 2
                },
                {
                    "Id": "0:2",
                    "PartitionPaths": [],
                    "SizeGB": 14
                },
                {
                    "Id": "0:3",
                    "PartitionPaths": [],
                    "SizeGB": 8
                },
                {
                    "Id": "0:4",
                    "PartitionPaths": [],
                    "SizeGB": 15
                }
            ],

@gavin-lai
Copy link
Author

Hi Anton, what version of CLI are you using? I cut and paste your command in a Windows environment and change the server name and I got the same error.
Thanks
Gavin

@antonsoroko
Copy link

Hi.
I've used the latest version from https://github.com/CenturyLinkCloud/clc-go-cli/releases
(clc-v1.1.0-linux-amd64.tar.gz, to be precise)

$ clc version

-------------------------------------------------------------

   _____           __                    __    _        __
  / ___/___  ___  / /_ __ __ ____ __ __ / /   (_)___   / /__
 / /__ / -_)/ _ \/ __// // // __// // // /__ / // _ \ /  '_/
 \___/ \__//_//_/\__/ \_,_//_/   \_, //____//_//_//_//_/\_\
                                /___/

-------------------------------------------------------------
CenturyLink Cloud CLI (Version v1.1.0)
https://github.com/CenturyLinkCloud/clc-go-cli

Go Version: go1.7.1 linux/amd64
Built on: 2016-11-24_01:48:24pm
Git Commit: 489cade9e389037d776254c8668667f14da59f2c

For more information on CenturyLink Cloud visit: http://www.ctl.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants