class AhvVmSmallProfile(VmProfile): """ Small Ahv Vm Profile""" # Profile variables nameserver = Var(DNS_SERVER, label="Local DNS resolver") # VM Spec for Substrate provider_spec = ahv_vm(resources=SmallAhvVmResources, name="SmallAhvVm") # Readiness probe for substrate (disabled is set to false, for enabling check login) readiness_probe = readiness_probe(credential=ref(Centos), disabled=False) # Only actions under Packages, Substrates and Profiles are allowed @action def __install__(): Task.Exec.ssh( name="Task1", filename=os.path.join("scripts", "mysql_install_script.sh") ) @action def __pre_create__(): Task.Exec.escript(name="Pre Create Task", script="print 'Hello!'") @action def test_profile_action(): Task.Exec.ssh(name="Task9", script='echo "Hello"')
class AhvVmSubstrate(Substrate): """AHV VM config given by reading a spec file""" provider_spec = ahv_vm( resources=MyAhvLinuxVmResources, categories={"AppFamily": "Backup", "AppType": "Default"}, ) readiness_probe = readiness_probe(disabled=True)
class AhvVmLargeProfile(AhvVmSmallProfile): """ Large Ahv Vm Profile """ provider_spec = ahv_vm(resources=LargeAhvVmResources, name="LargeAhvVm")