class AHVRedisMasterSubstrate(Substrate): provider_spec = read_ahv_spec( "specs/substrate/ahv_spec_centos.yaml", disk_packages={1: AHV_CENTOS_76} ) provider_spec.spec["name"] = "Redis_Master-@@{calm_array_index}@@-@@{calm_random}@@" os_type = "Linux" readiness_probe = { "disabled": False, "delay_secs": "60", "connection_type": "SSH", "connection_port": 22, "credential": ref(DefaultCred), } editables = { "create_spec": { "resources": { "nic_list": {}, "disk_list": True, "num_vcpus_per_socket": True, "num_sockets": True, "memory_size_mib": True, "serial_port_list": {}, } } }
class AHVRedisSlaveSubstrate(Substrate): os_type = "Linux" provider_spec = read_ahv_spec( "specs/substrate/ahv_spec_centos.yaml", disk_packages={1: AHV_CENTOS_76} ) provider_spec.spec["name"] = "Redis_Slave-@@{calm_array_index}@@-@@{calm_random}@@" readiness_probe = { "disabled": False, "delay_secs": "60", "connection_type": "SSH", "connection_port": 22, "credential": ref(DefaultCred), }
class HAProxySubstrate(Substrate): os_type = "Linux" provider_type = "AHV_VM" provider_spec = read_ahv_spec("specs/haproxy-spec.yaml", disk_packages={1: CENTOS_7_CLOUD}) readiness_probe = { "connection_type": "SSH", "connection_port": 22, "connection_protocol": "", "timeout_secs": "", "delay_secs": "60", "retries": "5", "address": "@@{platform.status.resources.nic_list[0].ip_endpoint_list[0].ip}@@", "disabled": False, } readiness_probe["credential"] = ref(default_credential)
class CentOS_Substrate(Substrate): """CentOS Substrate""" os_type = "Linux" provider_spec = read_ahv_spec("centos-spec.yaml", disk_packages={1: AHV_CENTOS_76}) provider_spec.spec["name"] = "@@{calm_application_name}@@" provider_spec.spec["resources"]["nic_list"][0]["subnet_reference"][ "name"] = ENV.get("SUBNET_NAME") provider_spec.spec["resources"]["nic_list"][0]["subnet_reference"][ "uuid"] = ENV.get("SUBNET_UUID") readiness_probe = { "disabled": False, "delay_secs": "60", "connection_type": "SSH", "connection_port": 22, "credential": ref(Cred_OS), }
class MySQLSubstrate(Substrate): """ The Calm Substrate outlines the "wrapper" for our VM, e.g. the VM's operating system, the VM spec from specs/mysql-spec.yaml, the disks the VM will have attached etc. """ os_type = "Linux" provider_type = "AHV_VM" provider_spec = read_ahv_spec("specs/mysql-spec.yaml", disk_packages={1: CENTOS_7_CLOUD}) readiness_probe = { "connection_type": "SSH", "connection_port": 22, "connection_protocol": "", "timeout_secs": "", "delay_secs": "60", "retries": "5", "address": "@@{platform.status.resources.nic_list[0].ip_endpoint_list[0].ip}@@", "disabled": False, } readiness_probe["credential"] = ref(default_credential)
class AHVVMforMySQL(Substrate): """AHV VM config given by reading a spec file""" provider_spec = read_ahv_spec( "specs/ahv_provider_spec.yaml", disk_packages={1: Virtio} )