yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/apis/compute/storage_const.go (about)

     1  // Copyright 2019 Yunion
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package compute
    16  
    17  const (
    18  	STORAGE_LOCAL     = "local"
    19  	STORAGE_BAREMETAL = "baremetal"
    20  	STORAGE_SHEEPDOG  = "sheepdog"
    21  	STORAGE_RBD       = "rbd"
    22  	STORAGE_DOCKER    = "docker"
    23  	STORAGE_NAS       = "nas"
    24  	STORAGE_VSAN      = "vsan"
    25  	STORAGE_NFS       = "nfs"
    26  	STORAGE_GPFS      = "gpfs"
    27  	STORAGE_CIFS      = "cifs"
    28  
    29  	STORAGE_PUBLIC_CLOUD     = "cloud"
    30  	STORAGE_CLOUD_EFFICIENCY = "cloud_efficiency"
    31  	STORAGE_CLOUD_SSD        = "cloud_ssd"
    32  	STORAGE_CLOUD_ESSD       = "cloud_essd"     // 增强型(Enhanced)SSD 云盘, 单盘最高随机读写IOPS 5万
    33  	STORAGE_CLOUD_ESSD_PL2   = "cloud_essd_pl2" // 单盘最高随机读写IOPS 10万
    34  	STORAGE_CLOUD_ESSD_PL3   = "cloud_essd_pl3" // 单盘最高随机读写IOPS 100万
    35  	STORAGE_EPHEMERAL_SSD    = "ephemeral_ssd"  // 单块本地SSD盘, 容量最大不能超过800 GiB
    36  	STORAGE_LOCAL_HDD_PRO    = "local_hdd_pro"  // 实例规格族d1ne和d1搭载的SATA HDD本地盘
    37  	STORAGE_LOCAL_SSD_PRO    = "local_ssd_pro"  // 实例规格族i2、i2g、i1、ga1和gn5等搭载的NVMe
    38  
    39  	//Azure hdd and ssd storagetype
    40  	STORAGE_STANDARD_LRS          = "standard_lrs"
    41  	STORAGE_STANDARDSSD_LRS       = "standardssd_lrs"
    42  	STORAGE_PREMIUM_LRS           = "premium_lrs"
    43  	STORAGE_AZURE_BASIC           = "basic_storage"
    44  	STORAGE_AZURE_GENERAL_PURPOSE = "general_purpose_storage"
    45  
    46  	// aws storage type
    47  	STORAGE_GP2_SSD      = "gp2"      // aws general purpose ssd
    48  	STORAGE_GP3_SSD      = "gp3"      // aws General Purpose SSD (gp3)
    49  	STORAGE_IO1_SSD      = "io1"      // aws Provisioned IOPS SSD
    50  	STORAGE_IO2_SSD      = "io2"      // aws Provisioned IOPS 2 SSD
    51  	STORAGE_ST1_HDD      = "st1"      // aws Throughput Optimized HDD
    52  	STORAGE_SC1_HDD      = "sc1"      // aws Cold HDD
    53  	STORAGE_STANDARD_HDD = "standard" // aws Magnetic volumes
    54  
    55  	// qcloud storage type
    56  	// STORAGE_CLOUD_SSD ="cloud_ssd"
    57  	STORAGE_LOCAL_BASIC   = "local_basic"
    58  	STORAGE_LOCAL_SSD     = "local_ssd"
    59  	STORAGE_LOCAL_PRO     = "local_pro"
    60  	STORAGE_CLOUD_BASIC   = "cloud_basic"
    61  	STORAGE_CLOUD_PREMIUM = "cloud_premium" //高性能云硬盘
    62  	STORAGE_CLOUD_HSSD    = "cloud_hssd"    //增强型SSD云硬盘
    63  
    64  	// huawei storage type
    65  	STORAGE_HUAWEI_SSD   = "SSD"   // 超高IO云硬盘
    66  	STORAGE_HUAWEI_SAS   = "SAS"   // 高IO云硬盘
    67  	STORAGE_HUAWEI_SATA  = "SATA"  // 普通IO云硬盘
    68  	STORAGE_HUAWEI_GPSSD = "GPSSD" // 通用型SSD
    69  	STORAGE_HUAWEI_ESSD  = "ESSD"  // 急速型SSD
    70  
    71  	// openstack
    72  	STORAGE_OPENSTACK_ISCSI = "iscsi"
    73  	STORAGE_OPENSTACK_NOVA  = "nova"
    74  
    75  	// Ucloud storage type
    76  	STORAGE_UCLOUD_CLOUD_NORMAL         = "CLOUD_NORMAL"         // 普通云盘
    77  	STORAGE_UCLOUD_CLOUD_SSD            = "CLOUD_SSD"            // SSD云盘
    78  	STORAGE_UCLOUD_LOCAL_NORMAL         = "LOCAL_NORMAL"         // 普通本地盘
    79  	STORAGE_UCLOUD_LOCAL_SSD            = "LOCAL_SSD"            // SSD本地盘
    80  	STORAGE_UCLOUD_EXCLUSIVE_LOCAL_DISK = "EXCLUSIVE_LOCAL_DISK" // 独享本地盘
    81  
    82  	// Zstack storage type
    83  	STORAGE_ZSTACK_LOCAL_STORAGE = "localstorage"
    84  	STORAGE_ZSTACK_CEPH          = "ceph"
    85  
    86  	// Google storage type
    87  	STORAGE_GOOGLE_LOCAL_SSD   = "local-ssd"   //本地SSD暂存盘 (最多8个)
    88  	STORAGE_GOOGLE_PD_STANDARD = "pd-standard" //标准永久性磁盘
    89  	STORAGE_GOOGLE_PD_SSD      = "pd-ssd"      //SSD永久性磁盘
    90  	STORAGE_GOOGLE_PD_BALANCED = "pd-balanced" //平衡永久性磁盘
    91  
    92  	// ctyun storage type
    93  	STORAGE_CTYUN_SSD  = "SSD"  // 超高IO云硬盘
    94  	STORAGE_CTYUN_SAS  = "SAS"  // 高IO云硬盘
    95  	STORAGE_CTYUN_SATA = "SATA" // 普通IO云硬盘
    96  
    97  	// jd cloud storage type
    98  	STORAGE_JDCLOUD_GP1 = "ssd.gp1"     // 通用型SSD云硬盘
    99  	STORAGE_JDCLOUD_IO1 = "ssd.io1"     // 性能型SSD云硬盘
   100  	STORAGE_JDCLOUD_STD = "hdd.std1"    // 容量型HDD云硬盘
   101  	STORAGE_JDCLOUD_SSD = "ssd"         // SSD云硬盘
   102  	STORAGE_JDCLOUD_PHD = "premium-hdd" // HDD云硬盘
   103  
   104  	STORAGE_ECLOUD_CAPEBS = "capebs" // 容量盘
   105  	STORAGE_ECLOUD_EBS    = "ebs"    // 性能盘
   106  	STORAGE_ECLOUD_SSD    = "ssd"    // 高性能盘
   107  	STORAGE_ECLOUD_SSDEBS = "ssdebs" // 性能优化盘
   108  	STORAGE_ECLOUD_SYSTEM = "system" // 系统盘
   109  )
   110  
   111  const (
   112  	STORAGE_ENABLED = "enabled"
   113  	// STORAGE_DISABLED = "disabled"
   114  	STORAGE_OFFLINE = "offline" // 离线
   115  	STORAGE_ONLINE  = "online"  // 在线
   116  	STORAGE_UNMOUNT = "unmount" // 待挂载
   117  
   118  	DISK_TYPE_ROTATE = "rotate"
   119  	DISK_TYPE_SSD    = "ssd"
   120  	DISK_TYPE_HYBRID = "hybrid"
   121  )
   122  
   123  const (
   124  	RBD_DEFAULT_MON_TIMEOUT   = 5       //5 seconds 连接超时时间
   125  	RBD_DEFAULT_OSD_TIMEOUT   = 20 * 60 //20 minute 操作超时时间
   126  	RBD_DEFAULT_MOUNT_TIMEOUT = 2 * 60  //CephFS挂载超时时间, 目前未使用
   127  )
   128  
   129  var (
   130  	DISK_TYPES          = []string{DISK_TYPE_ROTATE, DISK_TYPE_SSD, DISK_TYPE_HYBRID}
   131  	STORAGE_LOCAL_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_UCLOUD_LOCAL_NORMAL, STORAGE_UCLOUD_LOCAL_SSD, STORAGE_UCLOUD_EXCLUSIVE_LOCAL_DISK,
   132  		STORAGE_EPHEMERAL_SSD, STORAGE_LOCAL_BASIC, STORAGE_LOCAL_SSD, STORAGE_LOCAL_PRO, STORAGE_OPENSTACK_NOVA,
   133  		STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_GOOGLE_LOCAL_SSD}
   134  	STORAGE_SUPPORT_TYPES = STORAGE_LOCAL_TYPES
   135  	STORAGE_ALL_TYPES     = []string{
   136  		STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_SHEEPDOG,
   137  		STORAGE_RBD, STORAGE_DOCKER, STORAGE_NAS, STORAGE_VSAN,
   138  		STORAGE_NFS, STORAGE_GPFS, STORAGE_CIFS,
   139  	}
   140  	STORAGE_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_SHEEPDOG,
   141  		STORAGE_RBD, STORAGE_DOCKER, STORAGE_NAS, STORAGE_VSAN, STORAGE_NFS,
   142  		STORAGE_PUBLIC_CLOUD, STORAGE_CLOUD_SSD, STORAGE_CLOUD_ESSD, STORAGE_CLOUD_ESSD_PL2, STORAGE_CLOUD_ESSD_PL3,
   143  		STORAGE_EPHEMERAL_SSD, STORAGE_CLOUD_EFFICIENCY,
   144  		STORAGE_STANDARD_LRS, STORAGE_STANDARDSSD_LRS, STORAGE_PREMIUM_LRS,
   145  		STORAGE_GP2_SSD, STORAGE_GP3_SSD, STORAGE_IO1_SSD, STORAGE_ST1_HDD, STORAGE_SC1_HDD, STORAGE_STANDARD_HDD,
   146  		STORAGE_LOCAL_BASIC, STORAGE_LOCAL_SSD, STORAGE_CLOUD_BASIC, STORAGE_CLOUD_PREMIUM,
   147  		STORAGE_HUAWEI_SSD, STORAGE_HUAWEI_SAS, STORAGE_HUAWEI_SATA,
   148  		STORAGE_OPENSTACK_ISCSI, STORAGE_UCLOUD_CLOUD_NORMAL, STORAGE_UCLOUD_CLOUD_SSD,
   149  		STORAGE_UCLOUD_LOCAL_NORMAL, STORAGE_UCLOUD_LOCAL_SSD, STORAGE_UCLOUD_EXCLUSIVE_LOCAL_DISK,
   150  		STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_ZSTACK_CEPH, STORAGE_GPFS, STORAGE_CIFS,
   151  	}
   152  
   153  	HOST_STORAGE_LOCAL_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_ZSTACK_LOCAL_STORAGE, STORAGE_OPENSTACK_NOVA}
   154  
   155  	STORAGE_LIMITED_TYPES = []string{STORAGE_LOCAL, STORAGE_BAREMETAL, STORAGE_NAS, STORAGE_RBD, STORAGE_NFS, STORAGE_GPFS, STORAGE_VSAN, STORAGE_CIFS}
   156  
   157  	SHARED_FILE_STORAGE = []string{STORAGE_NFS, STORAGE_GPFS}
   158  	FIEL_STORAGE        = []string{STORAGE_LOCAL, STORAGE_NFS, STORAGE_GPFS}
   159  
   160  	// 目前来说只支持这些
   161  	SHARED_STORAGE = []string{STORAGE_NFS, STORAGE_GPFS, STORAGE_RBD}
   162  )