def __init__(self, parent, *args, **kwargs): super().__init__(parent, *args, **kwargs) v = vms[self.id] self.set_name(v.name) self.set_description(v.description) self.set_description(v.description) self.set_small_icon( svc.base_link("Icons", "00000000-0000-0000-0000-000000000000")) self.set_large_icon( svc.base_link("Icons", "00000000-0000-0000-0000-000000000000")) self.set_memory(1073741824) self.set_memory_policy(MemoryPolicy(1073741824)) t = CpuTopology() t.set_sockets(1) t.set_cores(1) #int(h.cpus)) t.set_threads(1) cpu = CPU() cpu.set_architecture(Architecture.UNDEFINED) cpu.set_topology(t) self.set_cpu(cpu) self.set_cpu_shares(0) self.set_os(OperatingSystem(OsType.OTHER)) self.set_stateless(False) self.set_delete_protected(False) self.set_high_availability(HighAvailability(enabled=False)) self.set_start_paused(False)
def __init__(self, parent, guid, *args, **kwargs): super().__init__(parent, guid, *args, **kwargs) h = hosts[self.id] self.set_status(Status(HostStatus.UP)) self.set_name(h.name) self.set_description(h.description) self.set_status(Status(HostStatus.UP)) self.set_external_status(Status(EntityExternalStatus.OK)) self.set_cluster(svc.base_link("Clusters", h.cluster)) self.set_type(HostType.RHEL) self.set_storage_manager(StorageManager(5, False)) self.set_version(Version(major=3, minor=6)) self.set_ksm(KSM(enabled=False)) self.set_power_management(PowerManagement(enabled=False)) self.set_live_snapshot_support(False) self.set_transparent_hugepages(TransparentHugePages(enabled=False)) self.set_memory(h.memory) self.set_max_scheduling_memory(h.memory) self.set_summary( VmSummary(active=len(hosts), migrating=0, total=len(hosts))) t = CpuTopology() t.set_sockets(1) t.set_cores(1) #int(h.cpus)) t.set_threads(1) self.set_cpu(CPU(topology=t))
def __init__(self, parent, guid, *args, **kwargs): super().__init__(parent, guid, *args, **kwargs) sd = storagedomains[self.id] self.set_name(sd.name) self.set_description(sd.description) self.set_type(StorageDomainType.DATA) self.set_master(False) self.set_available(12884901888) self.set_used(4294967296) self.set_committed(0) self.set_storage_format(StorageFormat.V1) self.set_wipe_after_delete(False) self.set_critical_space_action_blocker(5) self.set_status(Status(StorageDomainStatus.ACTIVE)) self.set_external_status(Status(EntityExternalStatus.OK)) dcref = svc.base_link("DataCenters", sd.datacenter) self.set_data_center(dcref) self.set_data_centers(sdk.DataCenters(data_center=[dcref])) stg = sdk.Storage() stg.set_address("127.0.0.1") stg.set_type(StorageType.NFS) stg.set_path("/mnt") stg.set_nfs_version(NfsVersion.AUTO) self.set_storage(stg)
def __init__(self, parent, guid, *args, **kwargs): super().__init__(parent, guid, *args, **kwargs) c = clusters[self.id] self.set_name(c.name) self.set_description(c.description) self.set_data_center(svc.base_link("DataCenters", c.datacenter)) self.set_virt_service(True) self.set_gluster_service(False) self.set_trusted_service(False) self.set_threads_as_cores(False) self.set_tunnel_migration(False) self.set_ha_reservation(False) self.set_optional_reason(False) self.set_maintenance_reason_required(False) self.set_ballooning_enabled(False) cpu = CPU() cpu.set_id("IBM System z") cpu.set_architecture(Architecture.UNDEFINED) self.set_cpu(cpu) moc = MemoryOverCommit() moc.set_percent(100) self.set_memory_policy(sdk.MemoryPolicy(overcommit=moc)) version = Version(major=3, minor=6) self.set_version(version)
def __init__(self, parent, guid, *args, **kwargs): super().__init__(parent, guid, *args, **kwargs) n = networks[self.id] self.set_name(n.name) self.set_description(n.description) self.set_data_center(svc.base_link("DataCenters", n.datacenter)) # self.set_cluster(svc.base_link("Clusters", n.cluster)) self.set_status(Status(NetworkStatus.OPERATIONAL)) self.set_display(True) self.set_required(True) self.set_mtu(0) u = sdk.Usages() u.add_usage(NetworkUsage.DISPLAY) u.add_usage(NetworkUsage.MIGRATION) u.add_usage(NetworkUsage.MANAGEMENT) u.add_usage(NetworkUsage.VM) self.set_usages(u)