def __init__(self, rdmcObj):
     RdmcCommandBase.__init__(self, \
         name='showbackupdevices', \
         usage='showbackupdevices\n\n\tDisplay the devices supported for use '\
         'as Scalable Persistent Memory\n\tbackup storage.\n\n\texample: '\
         'showbackupdevices', \
         summary='Display backup storage devices.', \
         aliases=['spmem-showdrives', 'spmemsd', 'showscalablepmemdrives'], \
         optparser=OptionParser())
     self._rdmc = rdmcObj
     self._helpers = Helpers()
     self._chif_lib = self._helpers.gethprestchifhandle()
 def __init__(self, rdmcObj):
     RdmcCommandBase.__init__(self, \
         name='enablescalablepmem', \
         usage='enablescalablepmem [OPTIONS]\n\n' \
             '\tEnables or disables the Scalable Persistent Memory feature.\n'\
             '\n\texample: enablescalablepmem', \
         summary='Enable or disable the Scalable Persistent Memory feature.', \
         aliases=['spmem-enable', 'spmemen'], \
         optparser=OptionParser())
     self.definearguments(self.parser)
     self._rdmc = rdmcObj
     self._helpers = Helpers()
     self._restHelpers = RestHelpers(self._rdmc)
     self._chif_lib = self._helpers.gethprestchifhandle()
Esempio n. 3
0
    def __init__(self, rdmcObj):
        RdmcCommandBase.__init__(self, \
            name='revertscalablepmemconfig', \
            usage='revertscalablepmemconfig\n\n'\
                '\tDiscards any pending Scalable Persistent Memory configuration '\
                'changes.\n\n\texample: revertscalablepmemconfig', \
            summary='Discard pending Scalable Persistent Memory configuration changes.',\
            aliases=['spmem-revertcfg', 'spmem-undocfg', 'spmemrc'], \
            optparser=OptionParser())

        self._rdmc = rdmcObj
        self._helpers = Helpers()
        self._restHelpers = RestHelpers(self._rdmc)
        self._validator = LogicalNvdimmValidator()
        self._chif_lib = self._helpers.gethprestchifhandle()
 def __init__(self, rdmcObj):
     RdmcCommandBase.__init__(self, \
         name='removelogicalnvdimm', \
         usage='removelogicalnvdimm (--processor=NUMBER --index=INDEX | '\
         '--pair=PAIR)\n\n\tRemove a logical NVDIMM. All data will be lost.\n'\
         '\n\texample: removelogicalnvdimm --processor=1 --index=1'\
         '\n\texample: removelogicalnvdimm --processors=1,2', \
         summary='Remove an existing logical NVDIMM.', \
         aliases=['lnvdimm-remove', 'lnr'], \
         optparser=OptionParser())
     self.definearguments(self.parser)
     self._rdmc = rdmcObj
     self._helpers = Helpers()
     self._restHelpers = RestHelpers(self._rdmc)
     self._chif_lib = self._helpers.gethprestchifhandle()
Esempio n. 5
0
 def __init__(self, rdmcObj):
     RdmcCommandBase.__init__(self, \
         name='setbackupdevices', \
         usage='setbackupdevices (--device=ID... | --remove-all)\n\n'\
             '\tSelect the devices to use for Scalable Persistent Memory '\
             'backup storage.\n\n\texample: setbackupdevices --device=1@1 '\
             '--device=1@2', \
         summary='Set backup storage devices.', \
         aliases=['spmem-setdrives', 'spmsetd', 'setbackupdrives'], \
         optparser=OptionParser())
     self.definearguments(self.parser)
     self._rdmc = rdmcObj
     self._helpers = Helpers()
     self._restHelpers = RestHelpers(self._rdmc)
     self._validator = LogicalNvdimmValidator()
     self._chif_lib = self._helpers.gethprestchifhandle()
Esempio n. 6
0
 def __init__(self, rdmcObj):
     RdmcCommandBase.__init__(self,\
         name='showscalablepmemconfig', \
         usage='showscalablepmemconfig [OPTIONS]\n\n'\
             '\tDisplay the Scalable Persistent Memory configuration.\n'\
             '\tIf system is configured, reports the estimated time to complete a backup boot.\n\n'\
             '\texample: showscalablepmemconfig', \
         summary='Display the Scalable Persistent Memory configuration.', \
         aliases=['spmem-showcfg', 'spmemsc'], \
         optparser=OptionParser())
     self.definearguments(self.parser)
     self._rdmc = rdmcObj
     self._helpers = Helpers()
     self._chif_lib = self._helpers.gethprestchifhandle()
     self._restHelpers = RestHelpers(rdmcObject=self._rdmc)
     self._options = None
Esempio n. 7
0
 def __init__(self, rdmcObj):
     RdmcCommandBase.__init__(self,\
         name='autoselectbackupdevices', \
         usage='autoselectbackupdevices --size=SIZE [--confirm]\n\n'\
         '\tAutomatically select the devices for use as Scalable '\
         'Persistent Memory backup storage.\n\n'\
         "\tDevices selected for backup storage will be initialized.\n"\
         "\tBack up all data first.\n" \
         '\n\texample: autoselectbackupdevices --size=1024 --confirm\n', \
         summary='Automatically select backup storage devices.', \
         aliases=['spmem-autosetd', 'spmemautosetd'],\
         optparser=OptionParser())
     self.definearguments(self.parser)
     self._rdmc = rdmcObj
     self._helpers = Helpers()
     self._restHelpers = RestHelpers(self._rdmc)
     self._validator = LogicalNvdimmValidator()
     self._chif_lib = self._helpers.gethprestchifhandle()
Esempio n. 8
0
    def __init__(self, rdmcObj):
        RdmcCommandBase.__init__(self, \
        name='replacebackupdevice', \
        usage="replacebackupdevice OLD-ID NEW-ID\n"\
            "\n\tReplace a Scalable Persistent Memory backup storage device.\n"\
            "\tSpecify devices by ID, e.g. '1@1' from the show backup device command.\n"\
            "\n\tThis operation initializes all backup storage devices."\
            "\n\tData on any existing logical NVDIMMs will be lost. Back up all data first.\n"\
            "\n\texample: replacebackupdevice 1@1 2@1", \
        summary='Replace a backup storage device.', \
        aliases=['spmem-replaced', 'spmreplaced'], \
        optparser=OptionParser())

        self._rdmc = rdmcObj
        self._helpers = Helpers()
        self._rest_helpers = RestHelpers(self._rdmc)
        self._validator = LogicalNvdimmValidator()
        self._chif_lib = self._helpers.gethprestchifhandle()
    def showDriveData(self):
        """ Main showlogicalnvdimmdrives command worker function

        :param options: command options
        :type options: options.
        """

        helpers = Helpers()
        restHelpers = RestHelpers(self._rdmc)
        validator = LogicalNvdimmValidator()

        scalable_pmem_config = ScalablePersistentMemoryConfig(restHelpers, \
                                                    validator, self._chif_lib)
        scalable_pmem_config.refresh()

        # pre-validation
        self._helpers.validateFeatureIsSupported(scalable_pmem_config)

        helpers.writeHeader2(
            u"Scalable Persistent Memory Backup Storage Devices")
        helpers.displayDrivesConfiguration(scalable_pmem_config)
        sys.stdout.write(u"\n")