Revision 1db993d5
b/lib/backend.py | ||
---|---|---|
2493 | 2493 |
|
2494 | 2494 |
config.add_section(constants.INISECT_INS) |
2495 | 2495 |
config.set(constants.INISECT_INS, "name", instance.name) |
2496 |
config.set(constants.INISECT_INS, "maxmem", "%d" % |
|
2497 |
instance.beparams[constants.BE_MAXMEM]) |
|
2498 |
config.set(constants.INISECT_INS, "minmem", "%d" % |
|
2499 |
instance.beparams[constants.BE_MINMEM]) |
|
2500 |
# "memory" is deprecated, but useful for exporting to old ganeti versions |
|
2496 | 2501 |
config.set(constants.INISECT_INS, "memory", "%d" % |
2497 |
instance.beparams[constants.BE_MEMORY])
|
|
2502 |
instance.beparams[constants.BE_MAXMEM])
|
|
2498 | 2503 |
config.set(constants.INISECT_INS, "vcpus", "%d" % |
2499 | 2504 |
instance.beparams[constants.BE_VCPUS]) |
2500 | 2505 |
config.set(constants.INISECT_INS, "disk_template", instance.disk_template) |
b/lib/cmdlib.py | ||
---|---|---|
8858 | 8858 |
for name, value in einfo.items(constants.INISECT_BEP): |
8859 | 8859 |
if name not in self.op.beparams: |
8860 | 8860 |
self.op.beparams[name] = value |
8861 |
# Compatibility for the old "memory" be param |
|
8862 |
if name == constants.BE_MEMORY: |
|
8863 |
if constants.BE_MAXMEM not in self.op.beparams: |
|
8864 |
self.op.beparams[constants.BE_MAXMEM] = value |
|
8865 |
if constants.BE_MINMEM not in self.op.beparams: |
|
8866 |
self.op.beparams[constants.BE_MINMEM] = value |
|
8861 | 8867 |
else: |
8862 | 8868 |
# try to read the parameters old style, from the main section |
8863 | 8869 |
for name in constants.BES_PARAMETERS: |
Also available in: Unified diff