用于管理Kamatera计算资源的SaltStack云模块

salt-cloud-module-kamatera的Python项目详细描述


盐云Kamatera模块

安装

  • Install Salt(2019.2.0或更高版本)
  • 使用与Salt一起安装的Python解释器安装模块:
    • pip install salt-cloud-module-kamatera

使用

请参阅Salt Cloud documentation以了解盐和盐云是如何工作的。在

配置

在Kamatera使用Salt需要一个API密钥和密码,您可以通过访问来获得 Kamatera Console并在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

服务器选项

位置

^{pr2}$

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主机+正确配置的网络):

salt my-server test.version

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java岩石、布、剪刀程序,带文件输入   java迭代Hashmap中的值列表   数组不能正确循环   JavaHibernate:对于一个遥远的惰性依赖,有一个渴望的获取者吗?   交通阻塞下的java车辆路径选择   如何在java中创建布尔方法来检查添加到具有特定索引的arraylist的对象   java Tomcat配置文件/上下文xml似乎已经崩溃了。请确保它是可分析和有效的。有关详细信息,请参阅服务器日志   为什么坐标有时相等,有时不相等?   java libgdx CameraInputController过于敏感,平移开始得太早   将C++排序函数移植到java   java应该是十进制的   swing Java JFrame中的所有内容都不可见   java使用数组中除一个元素以外的所有元素   从子类运行构造函数的Java