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

Enable RootDiskType for dynamic provisioning to fix Alibaba provisioning failures #1120

Merged
merged 3 commits into from
May 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions assets/cloudspec.csv
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
providerName,regionName,connectionName,cspSpecName,CostPerHour,evaluationScore01,evaluationScore02,evaluationScore03,evaluationScore04,evaluationScore05,evaluationScore06,evaluationScore07,evaluationScore08,evaluationScore09,evaluationScore10
alibaba,alibaba-ap-northeast-1,alibaba-ap-northeast-1,ecs.xn4.small,0.015,34.62,,,,,,,,,
alibaba,alibaba-ap-northeast-1,alibaba-ap-northeast-1,ecs.t5-lc1m2.large,0.013,33.85,,,,,,,,,
alibaba,alibaba-ap-northeast-1,alibaba-ap-northeast-1,ecs.t5-lc1m1.small,0.013,34.07,,,,,,,,,
alibaba,alibaba-ap-northeast-1,alibaba-ap-northeast-1,ecs.t1.small,0.013,34.29,,,,,,,,,
alibaba,alibaba-ap-northeast-1,alibaba-ap-northeast-1,ecs.s6-c1m1.small,0.011,33.41,,,,,,,,,
alibaba,alibaba-ap-northeast-1,alibaba-ap-northeast-1,ecs.n1.tiny,0.031,33.96,,,,,,,,,
alibaba,alibaba-ap-northeast-1,alibaba-ap-northeast-1,ecs.g6e.large,0.013,33.85,,,,,,,,,
alibaba,alibaba-ap-northeast-1,alibaba-ap-northeast-2,ecs.g6e.large,0.013,33.85,,,,,,,,,
alibaba,alibaba-ap-south-1,alibaba-ap-south-1,ecs.xn4.small,0.015,33.85,,,,,,,,,
alibaba,alibaba-ap-south-1,alibaba-ap-south-1,ecs.t5-lc1m1.small,0.013,33.85,,,,,,,,,
alibaba,alibaba-ap-south-1,alibaba-ap-south-1,ecs.t1.small,0.013,34.4,,,,,,,,,
Expand Down
3 changes: 2 additions & 1 deletion src/core/mcis/provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ type TbVmDynamicReq struct {
// CommonImage is field for id of a image in common namespace
CommonImage string `json:"commonImage" validate:"required" example:"ubuntu18.04"`

RootDiskType string `json:"rootDiskType,omitempty" example:"default, TYPE1, ..."` // "", "default", "TYPE1", AWS: ["standard", "gp2", "gp3"], Azure: ["PremiumSSD", "StandardSSD", "StandardHHD"], GCP: ["pd-standard", "pd-balanced", "pd-ssd", "pd-extreme"], ALIBABA: ["cloud_efficiency", "cloud", "cloud_essd"], TENCENT: ["CLOUD_PREMIUM", "CLOUD_SSD"]
RootDiskSize string `json:"rootDiskSize,omitempty" example:"default, 30, 42, ..."` // "default", Integer (GB): ["50", ..., "1000"]

// if ConnectionName is given, the VM tries to use associtated credential.
Expand Down Expand Up @@ -1181,7 +1182,7 @@ func CreateMcisDynamic(nsId string, req *TbMcisDynamicReq) (*TbMcisInfo, error)
vmReq.Label = k.Label
vmReq.VmGroupSize = k.VmGroupSize
vmReq.Description = k.Description
//vmReq.RootDiskType = k.RootDiskType
vmReq.RootDiskType = k.RootDiskType
vmReq.RootDiskSize = k.RootDiskSize

mcisReq.Vm = append(mcisReq.Vm, vmReq)
Expand Down
16 changes: 15 additions & 1 deletion src/testclient/scripts/8.mcis/add-vmgroup-to-mcis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
source ../init.sh

NUMVM=${OPTION01:-1}

if [[ -z "${DISK_TYPE[$INDEX,$REGION]}" ]]; then
RootDiskType="default"
else
RootDiskType="${DISK_TYPE[$INDEX,$REGION]}"
fi

if [[ -z "${DISK_SIZE[$INDEX,$REGION]}" ]]; then
RootDiskSize="default"
else
RootDiskSize="${DISK_SIZE[$INDEX,$REGION]}"
fi

curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/mcis/$MCISID/vmgroup -H 'Content-Type: application/json' -d \
'{
Expand All @@ -25,7 +37,9 @@
"vNetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"subnetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"description": "description",
"vmUserPassword": ""
"vmUserPassword": "",
"rootDiskType": "'${RootDiskType}'",
"rootDiskSize": "'${RootDiskSize}'"
}' | jq ''
#}

Expand Down
69 changes: 37 additions & 32 deletions src/testclient/scripts/8.mcis/create-mcis.sh
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
#!/bin/bash

#function create_mcis() {
echo "####################################################################"
echo "## 8. vm: Create MCIS"
echo "####################################################################"

echo "####################################################################"
echo "## 8. vm: Create MCIS"
echo "####################################################################"
source ../init.sh

source ../init.sh
NUMVM=${OPTION01:-1}

NUMVM=${OPTION01:-1}
echo "####################"
echo " AgentInstallOn: $AgentInstallOn"
echo "####################"

echo "####################"
echo " AgentInstallOn: $AgentInstallOn"
echo "####################"
if [[ -z "${DISK_TYPE[$INDEX,$REGION]}" ]]; then
RootDiskType="default"
else
RootDiskType="${DISK_TYPE[$INDEX,$REGION]}"
fi

# "name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
if [[ -z "${DISK_SIZE[$INDEX,$REGION]}" ]]; then
RootDiskSize="default"
else
RootDiskSize="${DISK_SIZE[$INDEX,$REGION]}"
fi

curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/mcis -H 'Content-Type: application/json' -d \
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/mcis -H 'Content-Type: application/json' -d \
'{
"name": "'${MCISID}'",
"description": "Tumblebug Demo",
"installMonAgent": "'${AgentInstallOn}'",
"label": "Generated by Script",
"systemLabel": "Managed-by-Tumblebug",
"vm": [ {
"vmGroupSize": "'${NUMVM}'",
"name": "'${CONN_CONFIG[$INDEX,$REGION]}'",
"imageId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"vmUserAccount": "cb-user",
"connectionName": "'${CONN_CONFIG[$INDEX,$REGION]}'",
"sshKeyId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"specId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"securityGroupIds": [
"'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'"
],
"vNetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"subnetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"description": "description",
"vmUserPassword": "",
"rootDiskType": "",
"rootDiskSize": "77"
}
"vmGroupSize": "'${NUMVM}'",
"name": "'${CONN_CONFIG[$INDEX,$REGION]}'",
"imageId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"vmUserAccount": "cb-user",
"connectionName": "'${CONN_CONFIG[$INDEX,$REGION]}'",
"sshKeyId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"specId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"securityGroupIds": [
"'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'"
],
"vNetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"subnetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"description": "description",
"vmUserPassword": "",
"rootDiskType": "'${RootDiskType}'",
"rootDiskSize": "'${RootDiskSize}'"
}
]
}' | jq ''
#}

#create_mcis
}' | jq ''
Loading