Revision 5a7fab74 src/Ganeti/HsConstants.hs

b/src/Ganeti/HsConstants.hs
1597 1597
   (hvPassthrough, "pci_pass"),
1598 1598
   (hvVncBindAddress, "VNC_bind_address")]
1599 1599

  
1600
-- * Migration statuses
1601

  
1602
hvMigrationActive :: String
1603
hvMigrationActive = "active"
1604

  
1605
hvMigrationCancelled :: String
1606
hvMigrationCancelled = "cancelled"
1607

  
1608
hvMigrationCompleted :: String
1609
hvMigrationCompleted = "completed"
1610

  
1611
hvMigrationFailed :: String
1612
hvMigrationFailed = "failed"
1613

  
1614
hvMigrationValidStatuses :: FrozenSet String
1615
hvMigrationValidStatuses =
1616
  ConstantUtils.mkSet [hvMigrationActive,
1617
                       hvMigrationCancelled,
1618
                       hvMigrationCompleted,
1619
                       hvMigrationFailed]
1620

  
1621
hvMigrationFailedStatuses :: FrozenSet String
1622
hvMigrationFailedStatuses =
1623
  ConstantUtils.mkSet [hvMigrationFailed, hvMigrationCancelled]
1624

  
1625
-- | KVM-specific statuses
1626
--
1627
-- FIXME: this constant seems unnecessary
1628
hvKvmMigrationValidStatuses :: FrozenSet String
1629
hvKvmMigrationValidStatuses = hvMigrationValidStatuses
1630

  
1631
-- | Node info keys
1632
hvNodeinfoKeyVersion :: String
1633
hvNodeinfoKeyVersion = "hv_version"
1634

  
1635
-- * Hypervisor state
1636

  
1637
hvstCpuNode :: String
1638
hvstCpuNode = "cpu_node"
1639

  
1640
hvstCpuTotal :: String
1641
hvstCpuTotal = "cpu_total"
1642

  
1643
hvstMemoryHv :: String
1644
hvstMemoryHv = "mem_hv"
1645

  
1646
hvstMemoryNode :: String
1647
hvstMemoryNode = "mem_node"
1648

  
1649
hvstMemoryTotal :: String
1650
hvstMemoryTotal = "mem_total"
1651

  
1652
hvstsParameters :: FrozenSet String
1653
hvstsParameters =
1654
  ConstantUtils.mkSet [hvstCpuNode,
1655
                       hvstCpuTotal,
1656
                       hvstMemoryHv,
1657
                       hvstMemoryNode,
1658
                       hvstMemoryTotal]
1659

  
1660
hvstDefaults :: Map String Int
1661
hvstDefaults =
1662
  Map.fromList
1663
  [(hvstCpuNode, 1),
1664
   (hvstCpuTotal, 1),
1665
   (hvstMemoryHv, 0),
1666
   (hvstMemoryTotal, 0),
1667
   (hvstMemoryNode, 0)]
1668

  
1669
hvstsParameterTypes :: Map String VType
1670
hvstsParameterTypes =
1671
  Map.fromList [(hvstMemoryTotal, VTypeInt),
1672
                (hvstMemoryNode, VTypeInt),
1673
                (hvstMemoryHv, VTypeInt),
1674
                (hvstCpuTotal, VTypeInt),
1675
                (hvstCpuNode, VTypeInt)]
1676

  
1677
-- * Disk state
1678

  
1679
dsDiskOverhead :: String
1680
dsDiskOverhead = "disk_overhead"
1681

  
1682
dsDiskReserved :: String
1683
dsDiskReserved = "disk_reserved"
1684

  
1685
dsDiskTotal :: String
1686
dsDiskTotal = "disk_total"
1687

  
1688
dsDefaults :: Map String Int
1689
dsDefaults =
1690
  Map.fromList
1691
  [(dsDiskTotal, 0),
1692
   (dsDiskReserved, 0),
1693
   (dsDiskOverhead, 0)]
1694

  
1695
dssParameterTypes :: Map String VType
1696
dssParameterTypes =
1697
  Map.fromList [(dsDiskTotal, VTypeInt),
1698
                (dsDiskReserved, VTypeInt),
1699
                (dsDiskOverhead, VTypeInt)]
1700

  
1701
dssParameters :: FrozenSet String
1702
dssParameters =
1703
  ConstantUtils.mkSet [dsDiskTotal, dsDiskReserved, dsDiskOverhead]
1704

  
1705
dsValidTypes :: FrozenSet String
1706
dsValidTypes = ConstantUtils.mkSet [Types.diskTemplateToRaw DTPlain]
1707

  
1600 1708
-- | Instance specs
1601 1709
--
1602 1710
-- FIXME: these should be associated with 'Ganeti.HTools.Types.ISpec'

Also available in: Unified diff