Closed BurlyLuo closed 1 month ago
you have a point. In the meantime, you can check in the samples repo, in particular in https://github.com/karmab/kcli-plan-samples/blob/main/cputuning/cpu.yml
From the demo we can see it with yaml format.
cpu:
memory: 512
cpumodel: core2duo
cpuflags:
- name: arat
enable: false
- name: avx2
enable: true
numcpus: 2
nets:
- default
pool: default
image: centos8stream
but how do we trans to cmds format?
and which parameter show the cpuping cpu?
cpuping is really needed for the kvm vm. do we need a pr to triggered the case?
[root@rowan> kcli]# kcli create vm -i centos9stream -P memory=4096 -P numcpus=4 -P cpupinning=['"vcpus": "0-1", hostcpus: "0"'] -P disks=[50] -P rootpassword=hive -P nets='[{"name":"brnet","ip":"192.168.2.200","netmask":"24","gateway":"192.168.2.1"}]' vm1
Deploying vm vm1 from image centos9stream...
vm1 not created because Can't process entry 0 in numa block
[root@rowan> kcli]#
for cpupinning, you have an example at https://github.com/karmab/kcli-plan-samples/blob/main/cputuning/numa.yml I ll add a single sample yaml file with all the parameters showcased.
Regarding using command line, while I dont really recommend it when you have more complex data structures, here's how it would transcribe:
kcli create vm -i centos9stream -P cpupinning=['{"vcpus": "0-6", "hostcpus": 0}','{"vcpus": 7, "hostcpus": 0}'] -P numcpus=8
for cpupinning, you have an example at https://github.com/karmab/kcli-plan-samples/blob/main/cputuning/numa.yml I ll add a single sample yaml file with all the parameters showcased.
Regarding using command line, while I dont really recommend it when you have more complex data structures, here's how it would transcribe:
kcli create vm -i centos9stream -P cpupinning=['{"vcpus": "0-6", "hostcpus": 0}','{"vcpus": 7, "hostcpus": 0}'] -P numcpus=8
kcli create vm -i centos9stream -P cpupinning=['{"vcpus": "0", "hostcpus": "0"}','{"vcpus": "1", "hostcpus": "1"}','{"vcpus": "2", "hostcpus": "2"}','{"vcpus": 3, "hostcpus": 3}'] -P numcpus=4 myvm
yes. agree with you. but if we can set by cmd method, it nice to setup the environment directly rather than maintain a template. What you see is what you get is important and direct. So i still do recommend that we can add one item to place one example for every sub-parameter. i am glad to test the func if needed. https://kcli.readthedocs.io/en/latest/#available-parameters-for-client-profile-plan-files thanks for your efforts about the nice project @karmab .
so I addressed that in two ways:
kcli render -f $file -c
allows to convert a plan file to kcli commandsso I addressed that in two ways:
- I updated the section about parameters in the doc to indicate that the url https://github.com/karmab/kcli/blob/main/samples/all_parameters.yml provides a complete listing of parameters in context
- I've added an extra flag to the render command so that
kcli render -f $file -c
allows to convert a plan file to kcli commands
[root@rowan> LabasCode]# kcli render -f all_parameters.yml -
usage: kcli [-h] [-C CLIENT] [--containerclient CONTAINERCLIENT] [--dnsclient DNSCLIENT] [-d] [-n NAMESPACE] [-o {json,jsoncompact,name,yaml}] [-r REGION] [-z ZONE]
...
kcli: error: unrecognized arguments: -
it should be -c
There is no such option.
[root@rowan> LabasCode]# kcli render -f all_p.yaml -c
usage: kcli [-h] [-C CLIENT] [--containerclient CONTAINERCLIENT] [--dnsclient DNSCLIENT] [-d] [-n NAMESPACE] [-o {json,jsoncompact,name,yaml}] [-r REGION] [-z ZONE]
...
kcli: error: unrecognized arguments: -c
[root@rowan> LabasCode]#
so I addressed that in two ways:
- I updated the section about parameters in the doc to indicate that the url https://github.com/karmab/kcli/blob/main/samples/all_parameters.yml provides a complete listing of parameters in context
- I've added an extra flag to the render command so that
kcli render -f $file -c
allows to convert a plan file to kcli commands[root@rowan> LabasCode]# kcli render -f all_parameters.yml - usage: kcli [-h] [-C CLIENT] [--containerclient CONTAINERCLIENT] [--dnsclient DNSCLIENT] [-d] [-n NAMESPACE] [-o {json,jsoncompact,name,yaml}] [-r REGION] [-z ZONE] ... kcli: error: unrecognized arguments: -
make sure to update kcli, as I've added in a recent commit
yes, with latest kcli, it works fine. but issue with: kcli create image -P url=
[root@rowan> LabasCode]# kcli download image http://192.168.2.100/Rocky9.qcow2
Image http://192.168.2.100/Rocky9.qcow2 has no associated url
[root@rowan> LabasCode]# kcli create image -P url=https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20210603.0.x86_64.qcow2 myimage
usage: kcli create [-h] ...
kcli create: error: argument : invalid choice: 'image' (choose from 'app', 'apps', 'operator', 'operators', 'bucket', 'bucket-file', 'clusterprofile', 'cluster-profile', 'kube-profile', 'kubeprofile', 'confpool', 'container', 'dns', 'host', 'client', 'kube', 'cluster', 'lb', 'loadbalancer', 'network', 'net', 'openshift-registry', 'openshift-disconnected', 'openshift-iso', 'openshift-sno', 'plan', 'plan-data', 'plan-template', 'plan-snapshot', 'pool', 'product', 'profile', 'provider', 'repo', 'security-group', 'sg', 'firewall', 'subnet', 'sushy-service', 'sushy', 'ksushy', 'ksushy-service', 'vm', 'vm-data', 'vm-disk', 'disk', 'vm-nic', 'nic', 'vm-snapshot', 'snapshot', 'web-service', 'web', 'workflow')
[root@rowan> LabasCode]# kcli version
version: 99.0 commit: 9e18d09 2024/09/24 Available Updates: False
[root@rowan> LabasCode]#
it should be
kcli download image -u http://192.168.2.100/Rocky9.qcow2 rocky9
it should be
kcli download image -u http://192.168.2.100/Rocky9.qcow2 rocky9
[root@rowan> ~]# kcli download image -u http://192.168.2.100/Rocky9.qcow2 rocky9
usage: kcli [-h] [-C CLIENT] [--containerclient CONTAINERCLIENT] [--dnsclient DNSCLIENT] [-d] [-n NAMESPACE] [-o {json,jsoncompact,name,yaml}] [-r REGION] [-z ZONE]
...
kcli: error: unrecognized arguments: -u rocky9
[root@rowan> ~]#
my bad :)
kcli download image -P url=http://192.168.2.100/Rocky9.qcow2 rocky9
my bad :)
kcli download image -P url=http://192.168.2.100/Rocky9.qcow2 rocky9
yes.
[root@rowan> images]# kcli download image -P url=http://192.168.2.100/Rocky9.qcow2 rocky9
can we set it into available-images? if yes, we can use such image directly.
[root@rowan> images]# kcli list available-images
+-----------------+
| Images |
+-----------------+
| almalinux8 |
| almalinux9 |
| arch |
| centos7 |
| centos8stream |
| centos9stream |
| cirros |
| debian10 |
| debian11 |
| debian12 |
| fcos |
| fedora37 |
| fedora38 |
| fedora39 |
| fedora40 |
| fedoralatest |
| freebsd122 |
| freebsd130 |
| netbsd82 |
| netbsd92 |
| openbsd71 |
| openbsd72 |
| dragonflybsd601 |
| dragonflybsd622 |
| gentoo |
| opensuse155 |
| opensuse156 |
| rhcos410 |
| rhcos411 |
| rhcos412 |
| rhcos413 |
| rhcos414 |
| rhcos415 |
| rhcos416 |
| rhcoslatest |
| rhel7 |
| rhel8 |
| rhel9 |
| ubuntu1804 |
| ubuntu2004 |
| ubuntu2204 |
| ubuntu2304 |
| ubuntu2310 |
| ubuntu2404 |
| rockylinux8 |
| rockylinux9 |
+-----------------+
[root@rowan> images]#
it's already there as rockylinux9
it's already there as rockylinux9
i mean custom image name. which like self_rocky9
Hello team: can we add an example for the item: https://kcli.readthedocs.io/en/latest/#available-parameters-for-client-profile-plan-files like cpupinning. we only get it's a list. but can't know how to add the parameter. have read the source code but not get the clue. so if we can add an example for each parameter, it will be nice for the beginner.