SaltStack云模块,用于管理Kamatera计算资源
项目描述
Salt Cloud Kamatera模块
安装
- 安装Salt(版本2019.2.0或更高版本)
- 使用与Salt安装相同的Python解释器安装模块
pip install salt-cloud-module-kamatera
使用
请参阅Salt Cloud文档,以了解Salt和Salt Cloud的一般工作原理。
配置
使用Salt管理Kamatera需要API密钥和密钥,您可以通过访问Kamatera控制台并在API密钥下添加新密钥来获取。在配置中使用创建的密钥ID和密钥。
# Note: This example is for /etc/salt/cloud.providers or any file in the
# /etc/salt/cloud.providers.d/ directory.
my-kamatera-config:
driver: kamatera
api_client_id: xxxxxxxxxxxxx
api_secret: yyyyyyyyyyyyyyyyyyyyyy
minion:
master: saltmaster.example.com
服务器选项
位置
# salt-cloud --list-locations my-kamatera-config
my-kamatera-config:
----------
kamatera:
----------
AS:
Hong Kong, China (Asia)
CA-TR:
Toronto, Canada (North America)
EU:
Amsterdam, The Netherlands (Europe)
...SNIP...
CPU类型
# salt-cloud --location=EU --list-sizes my-kamatera-config
my-kamatera-config:
----------
kamatera:
----------
A:
----------
cpuCores:
[1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32]
description:
Server CPUs are assigned to a non-dedicated physical CPU thread with no resources guaranteed.
name:
Type A - Availability
ramMB:
[256, 512, 1024, 2048, 3072, 4096, 6144, 8192, 10240, 12288, 16384, 24576, 32768, 49152, 65536, 98304, 131072]
B:
----------
cpuCores:
[1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 88, 104]
...SNIP...
其他服务器选项
# salt-cloud --location=EU -f avail_server_options my-kamatera-config
my-kamatera-config:
----------
kamatera:
----------
A:
----------
cpuCores:
[1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32]
description:
Server CPUs are assigned to a non-dedicated physical CPU thread with no resources guaranteed.
name:
Type A - Availability
ramMB:
[256, 512, 1024, 2048, 3072, 4096, 6144, 8192, 10240, 12288, 16384, 24576, 32768, 49152, 65536, 98304, 131072]
B:
----------
cpuCores:
[1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 88, 104]
...SNIP...
镜像
# salt-cloud --location=EU --list-images my-kamatera-config
my-kamatera-config:
----------
kamatera:
----------
EU:6000C2901a61dff371f4d1d34bd9548b:
Ubuntu Server version 16.04 LTS (xenial) 32-bit
EU:6000C29040fd67b51a229d7e641fba22:
Ubuntu Server version 18.04 LTS (bionic) 64-bit.
Optimized for best performance and with minimal OS services (OS use only 80MB RAM).
EU:6000C2904fc6d8295d2b6d9687ed955e:
Ubuntu Server version 18.04 LTS (bionic) 64-bit,
...SNIP...
创建服务器
在/etc/salt/cloud.profiles
或/etc/salt/cloud.profiles.d/
目录下设置云配置文件
my-kamatera-profile:
size: "my-size" # this is meaningless, required due to limitations in Salt Cloud
provider: my-kamatera-config
# salt-cloud --list-locations my-kamatera-config
location: EU
# salt-cloud --location EU --list-sizes my-kamatera-config
cpu_type: B
cpu_cores: 2
ram_mb: 2048
# primary disk size
# salt-cloud --location EU -f avail_server_options my-kamatera-config
disk_size_gb: 50
# up to 3 additional disks
extra_disk_sizes_gb:
- 100
- 200
# hourly / monthly
billing_cycle: monthly
# traffic package is only relevant for monthly billing cycle
# salt-cloud --location EU -f avail_server_options my-kamatera-config
monthly_traffic_package: t5000
# salt-cloud --location EU --list-images my-kamatera-config
image: EU:6000C29a5a7220dcf84716e7bba74215
# up to 4 network interfaces can be attached
# network name 'wan' provides a public IP
# you can add additional private networks in the Kamatera web-ui
networks:
- name: wan
ip: auto
# - name: my-lan-id
# ip: auto
# whether to enable daily backups for the created server
daily_backup: false
# whether to provide managed support service
managed: false
创建服务器
salt-cloud -p my-kamatera-profile my-server
在服务器上执行salt命令(需要Salt master +正确配置的网络)
salt my-server test.version
项目详情
关闭
哈希值 for salt_cloud_module_kamatera-0.0.3-py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 862c66c02ee883f06bcafed6ebd3d18a0dd334089ced8402e58c46c4d0b19c46 |
|
MD5 | 57ea620bc0d0332d420c31c4b39d8c18 |
|
BLAKE2b-256 | a8a1a7e33f504bcd8e6b466874bd61750004950d32772e90ddb4f9c84ea40bee |