├── applications │ ├── index.json │ ├── zstack_io_grafana │ │ └── aarch64 │ │ └── 11.2.0 │ │ ├── application.json │ │ ├── input.json │ │ ├── logo.png │ │ ├── output.json │ │ └── src │ │ ├── main.tf │ │ ├── output.tf │ │ ├── scripts │ │ │ └── check-health.sh │ │ ├── variables.tf │ │ └── version.tf │ │ └── x86_64 │ │ └── 11.2.0 │ │ ├── application.json │ │ ├── input.json │ │ ├── logo.png │ │ ├── output.json │ │ └── src │ │ ├── main.tf │ │ ├── output.tf │ │ ├── scripts │ │ │ └── check-health.sh │ │ ├── variables.tf │ │ └── version.tf
{ "name": "Grafana 是一款开源指标分析和可视化套件", "description": "Grafana 是一款开源指标分析和可视化套件,用于可视化支持各种数据源的时间序列数据,应用市场也提供对应ZStack监控模板", "details": "Grafana 是一款开源指标分析和可视化套件,用于可视化支持各种数据源的时间序列数据。 本应用由ZStack打包。产品中提及的相应商标归相应公司所有", "appId": "zstack.io.grafana", "category": "cloud", "connector_type": "zstack" }
[ { "name": "root_disk_size", "required": true, "default_value": 107374182400, "min": 107374182400, "tag": "ZStack::rootDiskSize" }, { "name": "memory_size", "required": true, "default_value": 4294967296, "min": 2147483648, "tag": "ZStack::memorySize" }, { "name": "l3_network_uuids", "en_label": "l3_network_uuids", "zh_label": "网络", "required": true, "tag": "ZStack::l3NetworkUuids" }, { "name": "cpu_num", "required": true, "default_value": 2, "min": 1, "tag": "ZStack::cpuNumber" }, { "name": "backup_storage_uuid", "required": true, "tag": "ZStack::backupStorageUuid" } ]
字段 | 字段释义 | 是否必须包含在input.json中 |
---|---|---|
ZStack::cpuNumber | CPU核数 | 是 |
ZStack::memorySize | 内存大小 | 是 |
ZStack::imageStoreUuid | 镜像服务器UUID | 否。本参数将由系统自动生成和展示 |
ZStack::rootDiskSize | 根云盘大小 | 是 |
ZStack::dataDiskSize | 数据云盘大小 | 否。可以选填一个或多个,input.json中包含几个该字段,表示部署时可设置几个数据云盘 |
ZStack::l3NetworkUuid | 三层网络UUID | 是。至少包含一个,也可以包含多个,input.json中包含几个该字段,表示部署时可设置几个三层网络 |
ZStack::l3NetworkIp | 指定网卡IP地址 | 否。如包含,必须先包含一个同组的ZStack::l3NetworkUuid。一个ZStack::l3NetworkUuid对应一个ZStack::l3NetworkIp |
ZStack::clusterUuid | 集群UUID | 是 |
ZStack::hostUuid | 物理机UUID | 是 |
ZStack::rootDiskPrimaryStorageUuid | 根云盘主存储UUID | 是 |
ZStack::rootDiskPrimaryStorageCephPoolUuid | 根云盘主存储存储池UUID | 如根云盘主存储为Ceph类型,则必须包含,和ZStack::rootDiskPrimaryStorageUuid一起指定 |
ZStack::dataDiskPrimaryStorageUuid | 数据云盘主存储UUID | 如已包含ZStack::dataDiskSize,则必须包含 |
ZStack::dataDiskPrimaryStorageCephPoolUuid | 数据云盘主存储存储池UUID | 如已包含ZStack::dataDiskSize且数据云盘主存储为Ceph类型,则必须包含,和ZStack::dataDiskPrimaryStorageUuid一起指定 |
ZStack::gpuDeviceUuid | GPU设备UUID | 否。如包含,则必须同时包含ZStack::gpuSpecsUuid和ZStack::gpuDeviceType |
ZStack::gpuSpecsUuid | GPU规格UUID | 否。如包含,则必须同时包含ZStack::gpuDeviceUuid和ZStack::gpuDeviceType |
ZStack::gpuDeviceType | GPU设备类型 | 否。如包含,则必须同时包含ZStack::gpuDeviceUuid和ZStack::gpuSpecsUuid |
[ { "name": "vm_uuids", "en_label": "vm_uuids", "zh_label": "vm_uuids", "type":"array", "tag":"ZStack:vmInstanceUuid" }, { "name": "application_protocol", "en_label": "Application Protocol", "zh_label": "应用协议", "type": "string", "tag": "Application:protocol" }, { "name": "application_ip", "en_label": "Application IP", "zh_label": "应用IP", "type":"string", "tag":"Application:ip" }, { "name": "application_port", "en_label": "Application Port", "zh_label": "应用端口", "type":"number", "tag":"Application:port" }, { "name": "default_account", "en_label": "Default User Name", "zh_label": "默认账号", "type":"string" }, { "name": "default_password", "en_label": "Default Password", "zh_label": "默认密码", "type":"password" } ]
resource "zstack_vm" "vm" { name = "Grafana" description = "应用市场-Grafana-可视化" root_disk = { size = {{.root_disk_size}} } l3_network_uuids = {{.l3_network_uuids}} memory_size = {{.memory_size}} cpu_num = {{.cpu_num}} marketplace = true never_stop = true } variable "l3Uuids" { type = list(string) default = {{.l3_network_uuids}} } data "zstack_l3network" "network" { depends_on = [zstack_vm.vm] uuid = var.l3Uuids[0] } resource "terraform_data" "healthy_check" { depends_on = [zstack_vm.vm] provisioner "local-exec" { command = var.wait_for_migrate_health_cmd environment = { ENDPOINT = "http://${zstack_vm.vm.ip}:3000/" } } }
output "vm_uuids" { value = zstack_vm.vm.uuid } output "application_protocol" { value = "http" } output "application_ip" { value = zstack_vm.vm.ip } output "application_port" { value = 3000 } output "default_account" { value = "admin" } output "default_password" { value = "password" } output "default_host_root_password" { value = "password" }
variable "wait_for_migrate_health_cmd" { description = "local-exec command to execute for determining if the Grafana url is healthy. Grafana endpoint will be available as an environment variable called ENDPOINT" type = string default = "start=$(date +%s); until curl -k -s $ENDPOINT >/dev/null; do sleep 4; now=$(date +%s); if [ $((now - start)) -ge 600 ]; then echo 'Timeout reached'; exit 1; fi; done" }
terraform { required_providers { zstack = { source = "zstack.io/terraform-provider-zstack/zstack" } } }
template = { source = "hashicorp/template" version = "2.2.0" } external = { source = "hashicorp/external" version = "2.3.3" } grafana = { source = "grafana/grafana" version = "3.2.1" } local = { source = "hashicorp/local" version = "2.5.1" } null = { source = "hashicorp/null" version = "3.2.3" }
#cloud-config runcmd: - | pv_list=$(pvs --noheadings -o pv_name) pv_count=$(echo "$pv_list" | wc -l) pv_name=$(echo "$pv_list" | tr -d ' ') vg_name=$(pvs --noheadings -o vg_name $pv_name | tr -d ' ') growpart $(echo $pv_name | sed 's/[0-9]*$//') $(echo $pv_name | grep -o '[0-9]*$') pvresize $pv_name lv_name=$(lvs --noheadings -o lv_name --sort -size | tail -1 | tr -d ' ') lvextend -l +100%FREE /dev/$vg_name/$lv_name lv_path="/dev/$vg_name/$lv_name" mapper_name=$(readlink -f $lv_path | awk -F '/' '{print $3}') lv_mapper_name=$(ls -l /dev/mapper/ | grep "$mapper_name" | awk '{print $9}') blkid | grep "/dev/mapper/$lv_mapper_name" | grep -q xfs if [ $? -eq 0 ]; then xfs_growfs /dev/mapper/$lv_mapper_name else resize2fs /dev/mapper/$lv_mapper_name fi partprobe
user_data = "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAgLSB8CiAgICBwdl9saXN0PSQocHZzIC0tbm9oZWFkaW5ncyAtbyBwdl9u \ YW1lKQogICAgcHZfY291bnQ9JChlY2hvICIkcHZfbGlzdCIgfCB3YyAtbCkKICAgIHB2X25hbWU9JChlY2hvICIkcHZfbGlzdCIgfCB0ciAtZCAnI \ CcpCgogICAgdmdfbmFtZT0kKHB2cyAtLW5vaGVhZGluZ3MgLW8gdmdfbmFtZSAkcHZfbmFtZSB8IHRyIC1kICcgJykKCiAgICBncm93cGFydCAkKG \ VjaG8gJHB2X25hbWUgfCBzZWQgJ3MvWzAtOV0qJC8vJykgJChlY2hvICRwdl9uYW1lIHwgZ3JlcCAtbyAnWzAtOV0qJCcpCiAgICBwdnJlc2l6ZSA \ kcHZfbmFtZQoKICAgIGx2X25hbWU9JChsdnMgLS1ub2hlYWRpbmdzIC1vIGx2X25hbWUgLS1zb3J0IC1zaXplIHwgdGFpbCAtMSB8IHRyIC1kICcg \ JykKCiAgICBsdmV4dGVuZCAtbCArMTAwJUZSRUUgL2Rldi8kdmdfbmFtZS8kbHZfbmFtZQoKICAgIGx2X3BhdGg9Ii9kZXYvJHZnX25hbWUvJGx2X \ 25hbWUiCiAgICBtYXBwZXJfbmFtZT0kKHJlYWRsaW5rIC1mICRsdl9wYXRoIHwgYXdrIC1GICcvJyAne3ByaW50ICQzfScpCgogICAgbHZfbWFwcG \ VyX25hbWU9JChscyAtbCAvZGV2L21hcHBlci8gfCBncmVwICIkbWFwcGVyX25hbWUiIHwgYXdrICd7cHJpbnQgJDl9JykKCiAgICBibGtpZCB8IGd \ yZXAgIi9kZXYvbWFwcGVyLyRsdl9tYXBwZXJfbmFtZSIgfCBncmVwIC1xIHhmcwoKICAgIGlmIFsgJD8gLWVxIDAgXTsgdGhlbgogICAgICAgIHhm \ c19ncm93ZnMgL2Rldi9tYXBwZXIvJGx2X21hcHBlcl9uYW1lCiAgICBlbHNlCiAgICAgICAgcmVzaXplMmZzIC9kZXYvbWFwcGVyLyRsdl9tYXBwZ \ XJfbmFtZQogICAgZmkKICAgIHBhcnRwcm9iZQ=="
学习路径
ZStack Cloud 产品学习路径
版本号:
ZStack Cloud 产品学习路径
快速梳理文档,点击相应文本链接,快速跳转到相应文档的页面,学习 ZStack Cloud 产品。
我知道了
业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1ZStack学院:
training@zstack.io业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io业务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。
信息提交成功。
我们将安排工作人员尽快与您取得联系,请保持电话畅通。感谢您使用 ZStack 产品和服务。
感谢您使用 ZStack 产品和服务。
商务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2商务联系:
sales@zstack.io成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。