vcpus <- extract "vcpus"
tags <- extract "tags"
dt <- extract "disk_template"
- return (n, Instance.create n mem disk vcpus Running tags True 0 0 dt 1)
+ su <- extract "spindle_use"
+ return (n, Instance.create n mem disk vcpus Running tags True 0 0 dt su)
-- | Parses an instance as found in the cluster instance list.
parseInstance :: NameAssoc -- ^ The node name-to-index association list
let orig = Container.find idx il
sorig = Instance.sNode orig
porig = Instance.pNode orig
- mir_type = templateMirrorType $ Instance.diskTemplate orig
+ mir_type = Instance.mirrorType orig
(exp_node, node_type, reloc_type) <-
case mir_type of
MirrorNone -> fail "Can't relocate non-mirrored instances"
-- | Reads the request from the data file(s).
readRequest :: FilePath -> IO Request
readRequest fp = do
- input_data <- readFile fp
+ input_data <- case fp of
+ "-" -> getContents
+ _ -> readFile fp
case parseData input_data of
Bad err -> do
hPutStrLn stderr $ "Error: " ++ err