-
Notifications
You must be signed in to change notification settings - Fork 47
Tencent Price Info Driver Development Guide
ByoungSeob Kim edited this page Jan 11, 2024
·
7 revisions
* Tencent Price Info 드라이버 개발관련 이슈를 위한 가이드
* 참고: Tencent tccli filter 옵션 활용 예시
* 참고: Tencent ProductFamily 제공 가이드
- GetPriceInfo()는 사용 가능한 제품들에 대한 정보 및 각 제품에 대해 선택할 수 있는 가격 정책/정보를 제공하는 API입니다.
- 사용자가 하나의 제품을 선택할 때 가격을 고려한다고 하면, 가능한 선택 가능한 가격 정책/정보를 한번에 확인하고 싶을 것 같습니다.
- 가이드에 안내 드렸던 바와 같이 주요 참고했던 AWS 또한 제품 정보에 대해 가능한 가격 정책/정보를 한번에 제공하고 있습니다.
- 현재는 Reserved 가격 정책을 별도로 분리하지 않고, 통합 제공하는 형태로 진행해보는 것이 좋을듯합니다.
- Tencent의 경우 제품 정보에 대한 Product ID를 제공하지 않음
- Tencent는
OnDemand
와Reserved
가격 정보가 별도의 API로 확인 필요-
OnDemand
:DescribeZoneInstanceConfigInfo()
-
Reserved
:DescribeReservedInstancesConfigInfos()
-
- 이러한 가격 정책 정보를 Spider가 제공하는 price info json 규격에 맞게 제품 기준으로 통합 하기 위해서는
- 동일한 product 선정 기준이 필요함
-
Zone + InstanceType
조건으로 유일한 제품으로 구분하면 될 것 같습니다.(아래 유일성 검증 참고)- 예시) ap-guangzhou-6 + S5.SMALL2
-
DescribeZoneInstanceConfigInfo()
,DescribeReservedInstancesConfigInfos()
또는 - 필요시
DescribeInstanceTypeConfigs()
등을 활용한 Spider price info json 결과를 생성
-
이슈: Tencent의 경우 제품 정보에 대한 Product ID를 제공하지 않음
-
안1) Spider에서도 값을 제공하지 않으며, 다음처럼
NA
로 설정- 예시)
"productInfo": { "productId": "NA",
- 예시)
-
안2) 위 2. 내용을 참고하여,
- Spider 사용자에게
Zone + InstanceType
조합으로 productId를 제공 - 예시)
"productInfo": { "productId": "ap-guangzhou-6:S5.SMALL2",
- Spider 사용자에게
- 이슈: Block Storage 가격 조회시 Size 입력이 필수임
- 현재 Spider에서 제공하는 Tencent DiskType 및 DiskType별 Min/Max Size 정보는 다음에서 관리/제공되고 있습니다.
- cloudos_meta.yaml
- 해당 정보 점검 및 필요시 업데이트 (참고: Cloud Disk Types, DescribeDiskConfigQuota API)
- Storage(Block Storage, data-disk) DiskType별 가격 정보를 다음과 같이
-
MinSize와 MaxSize 가격 정보를 함께 제공하는 방법을 검토해주시기 바랍니다.
-
MinSize 경우
... 생략 PricingId: "{DiskType}:MinDiskSize" Unit: "{MinSize}GB-Mo" ... 생략
ex) PricingId: "CLOUD_PREMIUM:MinDiskSize" Unit: "10GB-Mo"
-
MaxSize 경우
... 생략 PricingId: "{DiskType}:MaxDiskSize" Unit: "{MaxSize}GB-Mo" ... 생략
ex) PricingId: "CLOUD_PREMIUM:MaxDiskSize" Unit: "32000GB-Mo"
-
- 참고: Spider price info 중 가격 정책 관련 json 구조
type PricingPolicies struct { PricingId string `json:"pricingId"` PricingPolicy string `json:"pricingPolicy"` Unit string `json:"unit"` Currency string `json:"currency"` Price string `json:"price"` Description string `json:"description"` PricingPolicyInfo *PricingPolicyInfo `json:"pricingPolicyInfo,omitempty"` }
- 편의상 Tencent CLI(tccli) 활용한 검증
- 참고: API와 인자 및 filter 등이 동일함
- Zone 내에 제공되는 제품 정보 또는 가격 정보의 유일함을 확인
- 활용 cli 버전
$ tccli --version
3.0.1034.1
[DescribeInstanceTypeConfigs]
-
guangzhou-6
zone에서 제공하는 InstanceType 정보에서InstanceType
을 정열 후 중복으로 제공되는InstanceType
이 존재하는지uniq
전후 갯수를 확인 - 전후 개수가 동일하면, 유일함
-
guangzhou-6
의 경우 185개의 instance type을 제공
$ tccli cvm DescribeInstanceTypeConfigs --cli-unfold-argument --region ap-guangzhou --Filters.0.Name zone --Filters.0.Values ap-guangzhou-6 |grep \"InstanceType\" |sort |wc -l
185
$ tccli cvm DescribeInstanceTypeConfigs --cli-unfold-argument --region ap-guangzhou --Filters.0.Name zone --Filters.0.Values ap-guangzhou-6 |grep \"InstanceType\" |sort |uniq |wc -l
185
[DescribeZoneInstanceConfigInfos]
-
POSTPAID_BY_HOUR
filter 추가: 현재는 일단 spot paid 정책은 제외 -
guangzhou-6
의 경우 185개의 instance type 중 159개 type에 대해OnDemand
가격 정책을 제공
$ tccli cvm DescribeZoneInstanceConfigInfos --cli-unfold-argument --region ap-guangzhou --Filters.0.Name zone --Filters.0.Values ap-guangzhou-6 --Filters.1.Name instance-charge-type --Filters.1.Values POSTPAID_BY_HOUR |grep \"InstanceType\" |sort |wc -l
159
$ tccli cvm DescribeZoneInstanceConfigInfos --cli-unfold-argument --region ap-guangzhou --Filters.0.Name zone --Filters.0.Values ap-guangzhou-6 --Filters.1.Name instance-charge-type --Filters.1.Values POSTPAID_BY_HOUR |grep \"InstanceType\" |sort |uniq |wc -l
159
[DescribeReservedInstancesConfigInfos]
-
guangzhou-6
의 경우 185개의 instance type 중 52개 type에 대해Reserved
가격 정책을 제공
$ tccli cvm DescribeReservedInstancesConfigInfos --cli-unfold-argument --region ap-guangzhou --Filters.0.Name zone --Filters.0.Values ap-guangzhou-6 |grep \"InstanceType\" |sort |wc -l
52
$ tccli cvm DescribeReservedInstancesConfigInfos --cli-unfold-argument --region ap-guangzhou --Filters.0.Name zone --Filters.0.Values ap-guangzhou-6 |grep \"InstanceType\" |sort |uniq |wc -l
52
tccli cvm DescribeInstanceTypeConfigs --cli-unfold-argument --region ap-guangzhou --Filters.0.Name zone --Filters.0.Values ap-guangzhou-6 |more
{
"InstanceTypeConfigSet": [
{
"Zone": "ap-guangzhou-6",
"InstanceType": "SA2.SMALL1",
"InstanceFamily": "SA2",
"GPU": 0,
"CPU": 1,
"Memory": 1,
"FPGA": 0,
"GpuCount": 0.0
},
{
"Zone": "ap-guangzhou-6",
"InstanceType": "SA2.SMALL2",
"InstanceFamily": "SA2",
"GPU": 0,
"CPU": 1,
"Memory": 2,
"FPGA": 0,
"GpuCount": 0.0
},
{
"Zone": "ap-guangzhou-6",
"InstanceType": "S5.SMALL2",
"InstanceFamily": "S5",
"GPU": 0,
"CPU": 1,
"Memory": 2,
"FPGA": 0,
"GpuCount": 0.0
},
{
"Zone": "ap-guangzhou-6",
"InstanceType": "SA2.SMALL4",
"InstanceFamily": "SA2",
"GPU": 0,
"CPU": 1,
"Memory": 4,
"FPGA": 0,
"GpuCount": 0.0
},
{
"Zone": "ap-guangzhou-6",
"InstanceType": "S5.SMALL4",
"InstanceFamily": "S5",
"GPU": 0,
"CPU": 1,
"Memory": 4,
"FPGA": 0,
"GpuCount": 0.0
},
...
tccli cvm DescribeZoneInstanceConfigInfos --cli-unfold-argument --region ap-guangzhou --Filters.0.Name zone --Filters.0.Values ap-guangzhou-6 --Filters.1.Name instance-charge-type --Filters.1.Values POSTPAID_BY_HOUR |more
{
"InstanceTypeQuotaSet": [
{
"Zone": "ap-guangzhou-6",
"InstanceType": "S6.MEDIUM2",
"InstanceChargeType": "POSTPAID_BY_HOUR",
"NetworkCard": 100,
"Externals": {
"ReleaseAddress": null,
"UnsupportNetworks": [
"BASIC",
"VPC1.0"
],
"StorageBlockAttr": null
},
"Cpu": 2,
"Memory": 2,
"InstanceFamily": "S6",
"TypeName": "标准型S6",
"LocalDiskTypeList": [],
"Status": "SELL",
"Price": {
"UnitPrice": 0.04,
"ChargeUnit": "HOUR",
"OriginalPrice": null,
"DiscountPrice": null,
"Discount": 100,
"UnitPriceDiscount": 0.04,
"UnitPriceSecondStep": 0.04,
"UnitPriceDiscountSecondStep": 0.04,
"UnitPriceThirdStep": 0.04,
"UnitPriceDiscountThirdStep": 0.04,
"OriginalPriceThreeYear": null,
"DiscountPriceThreeYear": null,
"DiscountThreeYear": null,
"OriginalPriceFiveYear": null,
"DiscountPriceFiveYear": null,
"DiscountFiveYear": null,
"OriginalPriceOneYear": null,
"DiscountPriceOneYear": null,
"DiscountOneYear": null
},
"SoldOutReason": "",
"InstanceBandwidth": 2.0,
"InstancePps": 30,
"StorageBlockAmount": 0,
"CpuType": "Intel Ice Lake",
"Gpu": 0,
"Fpga": 0,
"Remark": "",
"GpuCount": 0.0,
"Frequency": "2.7GHz/3.3GHz",
"StatusCategory": "NormalStock"
},
{
"Zone": "ap-guangzhou-6",
"InstanceType": "S6.MEDIUM4",
"InstanceChargeType": "POSTPAID_BY_HOUR",
"NetworkCard": 100,
"Externals": {
"ReleaseAddress": null,
"UnsupportNetworks": [
"BASIC",
"VPC1.0"
],
"StorageBlockAttr": null
},
"Cpu": 2,
"Memory": 4,
"InstanceFamily": "S6",
"TypeName": "标准型S6",
"LocalDiskTypeList": [],
"Status": "SELL",
"Price": {
"UnitPrice": 0.06,
"ChargeUnit": "HOUR",
"OriginalPrice": null,
"DiscountPrice": null,
"Discount": 100,
"UnitPriceDiscount": 0.06,
"UnitPriceSecondStep": 0.06,
"UnitPriceDiscountSecondStep": 0.06,
"UnitPriceThirdStep": 0.06,
"UnitPriceDiscountThirdStep": 0.06,
"OriginalPriceThreeYear": null,
"DiscountPriceThreeYear": null,
"DiscountThreeYear": null,
"OriginalPriceFiveYear": null,
"DiscountPriceFiveYear": null,
"DiscountFiveYear": null,
"OriginalPriceOneYear": null,
"DiscountPriceOneYear": null,
"DiscountOneYear": null
},
"SoldOutReason": "",
"InstanceBandwidth": 2.0,
"InstancePps": 30,
"StorageBlockAmount": 0,
"CpuType": "Intel Ice Lake",
"Gpu": 0,
"Fpga": 0,
"Remark": "",
"GpuCount": 0.0,
"Frequency": "2.7GHz/3.3GHz",
"StatusCategory": "NormalStock"
},
{
"Zone": "ap-guangzhou-6",
"InstanceType": "S6.MEDIUM8",
"InstanceChargeType": "POSTPAID_BY_HOUR",
"NetworkCard": 100,
"Externals": {
"ReleaseAddress": null,
"UnsupportNetworks": [
"BASIC",
"VPC1.0"
],
"StorageBlockAttr": null
},
"Cpu": 2,
"Memory": 8,
"InstanceFamily": "S6",
"TypeName": "标准型S6",
"LocalDiskTypeList": [],
"Status": "SELL",
"Price": {
"UnitPrice": 0.08,
"ChargeUnit": "HOUR",
"OriginalPrice": null,
"DiscountPrice": null,
"Discount": 100,
"UnitPriceDiscount": 0.08,
"UnitPriceSecondStep": 0.08,
"UnitPriceDiscountSecondStep": 0.08,
"UnitPriceThirdStep": 0.08,
"UnitPriceDiscountThirdStep": 0.08,
"OriginalPriceThreeYear": null,
"DiscountPriceThreeYear": null,
"DiscountThreeYear": null,
"OriginalPriceFiveYear": null,
"DiscountPriceFiveYear": null,
"DiscountFiveYear": null,
"OriginalPriceOneYear": null,
"DiscountPriceOneYear": null,
"DiscountOneYear": null
},
"SoldOutReason": "",
"InstanceBandwidth": 2.0,
"InstancePps": 30,
"StorageBlockAmount": 0,
"CpuType": "Intel Ice Lake",
"Gpu": 0,
"Fpga": 0,
"Remark": "",
"GpuCount": 0.0,
"Frequency": "2.7GHz/3.3GHz",
"StatusCategory": "NormalStock"
},
tccli cvm DescribeReservedInstancesConfigInfos --cli-unfold-argument --region ap-guangzhou --Filters.0.Name zone --Filters.0.Values ap-guangzhou-6 |more
{
"ReservedInstanceConfigInfos": [
{
"Type": "S",
"TypeName": "标准型",
"Order": 100,
"InstanceFamilies": [
{
"InstanceFamily": "S5",
"Order": 88,
"InstanceTypes": [
{
"InstanceType": "S5.SMALL2",
"Cpu": 1,
"Memory": 2,
"Gpu": 0,
"Fpga": 0,
"StorageBlock": 0,
"NetworkCard": 25,
"MaxBandwidth": 1.5,
"Frequency": "2.5GHz/3.1GHz",
"CpuModelName": "Intel Xeon Cascade Lake 8255C/Intel Xeon Cooper Lake",
"Pps": 25,
"Externals": {
"ReleaseAddress": null,
"UnsupportNetworks": [
"BASIC",
"VPC1.0"
],
"StorageBlockAttr": null
},
"Remark": "",
"Prices": [
{
"OfferingType": "All Upfront",
"FixedPrice": 58.0,
"UsagePrice": 0.0,
"ReservedInstancesOfferingId": "ca8d39c3-4605-4e8d-9a21-05188cc9d1d4",
"Zone": "广州六区",
"Duration": 31536000,
"ProductDescription": "linux"
},
{
"OfferingType": "Partial Upfront",
"FixedPrice": 30.0,
"UsagePrice": 0.003,
"ReservedInstancesOfferingId": "17d28d85-4338-47c3-bd5e-ac5d2fc8a6fc",
"Zone": "广州六区",
"Duration": 31536000,
"ProductDescription": "linux"
},
{
"OfferingType": "No Upfront",
"FixedPrice": 0.0,
"UsagePrice": 0.008,
"ReservedInstancesOfferingId": "501f0a1e-1a34-4a95-bcdf-c46f5af67695",
"Zone": "广州六区",
"Duration": 31536000,
"ProductDescription": "linux"
}
]
},
{
"InstanceType": "S5.SMALL4",
"Cpu": 1,
"Memory": 4,
"Gpu": 0,
"Fpga": 0,
"StorageBlock": 0,
"NetworkCard": 25,
"MaxBandwidth": 1.5,
"Frequency": "2.5GHz/3.1GHz",
"CpuModelName": "Intel Xeon Cascade Lake 8255C/Intel Xeon Cooper Lake",
"Pps": 25,
"Externals": {
"ReleaseAddress": null,
"UnsupportNetworks": [
"BASIC",
"VPC1.0"
],
"StorageBlockAttr": null
},
"Remark": "",
"Prices": [
{
"OfferingType": "All Upfront",
"FixedPrice": 179.0,
"UsagePrice": 0.0,
"ReservedInstancesOfferingId": "98b1abd2-b201-4ad0-be60-9b59e7a09202",
"Zone": "广州六区",
"Duration": 31536000,
"ProductDescription": "linux"
},
{
"OfferingType": "Partial Upfront",
"FixedPrice": 90.0,
"UsagePrice": 0.01,
"ReservedInstancesOfferingId": "a4b37e89-30c6-41ee-a3d8-5a2774690a80",
"Zone": "广州六区",
"Duration": 31536000,
"ProductDescription": "linux"
},
{
"OfferingType": "No Upfront",
"FixedPrice": 0.0,
"UsagePrice": 0.024,
"ReservedInstancesOfferingId": "338c7a11-706c-48f5-95a0-4caf39005a83",
"Zone": "广州六区",
"Duration": 31536000,
"ProductDescription": "linux"
}
]
},
{
"InstanceType": "S5.MEDIUM4",
"Cpu": 2,
"Memory": 4,
"Gpu": 0,
"Fpga": 0,
"StorageBlock": 0,
"NetworkCard": 25,
"MaxBandwidth": 1.5,
"Frequency": "2.5GHz/3.1GHz",
"CpuModelName": "Intel Xeon Cascade Lake 8255C/Intel Xeon Cooper Lake",
"Pps": 30,
"Externals": {
"ReleaseAddress": null,
"UnsupportNetworks": [
"BASIC",
"VPC1.0"
],
"StorageBlockAttr": null
},
"Remark": "",
"Prices": [
{
"OfferingType": "All Upfront",
"FixedPrice": 219.0,
"UsagePrice": 0.0,
"ReservedInstancesOfferingId": "dc0c3401-7bf0-4782-be0b-31eb48a48d4c",
"Zone": "广州六区",
"Duration": 31536000,
"ProductDescription": "linux"
},
{
"OfferingType": "Partial Upfront",
"FixedPrice": 112.0,
"UsagePrice": 0.013,
"ReservedInstancesOfferingId": "851ecd86-235e-4e86-8c4d-2628c823275e",
"Zone": "广州六区",
"Duration": 31536000,
"ProductDescription": "linux"
},
{
"OfferingType": "No Upfront",
"FixedPrice": 0.0,
"UsagePrice": 0.029,
"ReservedInstancesOfferingId": "8a6f626f-3e56-4c0d-87c8-af333808df72",
"Zone": "广州六区",
"Duration": 31536000,
"ProductDescription": "linux"
}
]
},
$ tccli cvm DescribeInstanceTypeConfigs --region ap-seoul --filter InstanceTypeConfigSet[*].Zone
[
"ap-seoul-1",
"ap-seoul-1",
"ap-seoul-1",
"ap-seoul-1",
...
]
$ tccli cvm DescribeInstanceTypeConfigs --region ap-seoul --filter 'InstanceTypeConfigSet[*].{ZoneName:Zone, InstanceFamily:InstanceFamily, InstanceType:InstanceType}'
[
{
"ZoneName": "ap-seoul-1",
"InstanceFamily": "S5",
"InstanceType": "S5.8XLARGE64"
},
{
"ZoneName": "ap-seoul-1",
"InstanceFamily": "GN7",
"InstanceType": "GN7.10XLARGE160"
},
...
]
[Ref]
- DescribeInstanceTypeConfigs: https://www.tencentcloud.com/document/product/213/33260?lang=en
- DescribeZoneInstanceConfigInfos: https://www.tencentcloud.com/document/product/213/33254?lang=en
- DescribeReservedInstancesConfigInfos(Currently in Beta Test, 2023.12.): https://www.tencentcloud.com/document/product/213/38309?lang=en
- TCCLI-Using Advanced Features: https://www.tencentcloud.com/document/product/1013/33467
-
Install & Start Guide
-
Features & Usage
-
- AdminWeb Tool Guide
- CLI Tool Guide
- REST API Guide
-
Design
-
Developer Guide
-
Cloud Driver Developer Guide
- Cloud Driver Developer Guide-WIP
- VM SSH Key Development Guide-WIP
- VM User Development Guide
- What is the CSP SDK API Version of drivers
- Region Zone Info and Driver API
- Price Info and Driver API
- (StartVM TerminateVM) API Call Counts and Waiting
- StartVM and TerminateVM Main Flow of drivers
- VM Root Disk Configuration Guide
- Security Group Rules and Driver API
- Network Load Balancer and Driver API
- VM Snapshot, MyImage and Disk Overview
- Kubernetes and Driver API(PMKS, K8S)
- Tag and Cloud Driver API
- AnyCall API Extension Guide
-
Test Reports
- v0.2.8-for-espresso-release
- v0.3.0-espresso-release
- Azure:Terminating VM
- cb-user@VM: ssh login, sudo run
- v0.3.14 test for SG Source
- v0.4.0-cafemocha-release
- Test via REST API Gateway
- Test Reports of v0.4.11 (IID2 initial Version)
- Test Reports of v0.4.12 (Register & Unregister existing Resources)
- Test Reports for v0.6.0 Release
- How to ...
- How to provision GPU VMs
- How to Resolve the 'Failed to Connect to Database' Error
- How to test CB Spider with Mock Driver
- How to install CB Spider on WSL2 under 공유기/사설망
- How to install CB Spider on macOS
- How to run CB Spider Container on macOS
- How to install OpenStack on a VM for CB Spider Testing
- How to get Azure available Regions
- How to profile memory usage in Golang
- Deprecated:How to install protoc and plugins
- [For Cloud-Migrator]