intel / ipmctl

BSD 3-Clause "New" or "Revised" License
183 stars 62 forks source link

How can I delete a region? #107

Open ccrhx4 opened 5 years ago

ccrhx4 commented 5 years ago

Hello,

I am adding two new AEP DIMMs to the server. To avoid any surprise, I am trying to delete all the namespaces, regions previously configured. But I failed to delete regions. I can still see regions by ipmctl after disabling region by ndctl. So how can I erase all the configurations and safely reconfigure the hardware?

cmd> ndctl list -Ri [ { "dev":"region0", "size":270582939648, "available_size":270582939648, "max_available_extent":270582939648, "type":"pmem", "iset_id":-5782359445199707068, "state":"disabled", "persistence_domain":"memory_controller" } ]

cmd> ipmctl show -a -region

---ISetID=0xafc0eeb8893f2444--- SocketID=0x0000 PersistentMemoryType=AppDirect Capacity=252.0 GiB FreeCapacity=252.0 GiB HealthState=Healthy DimmID=0x0020, 0x0120

sscargal commented 5 years ago

You can delete the current namespaces and 'goal' which determines the region configuration at boot time. Then install the new DCPMM and create a new goal. Finally, you can then create the namespaces.

*) Check for namespaces

ndctl list -iN

Ignore any namespaces with "size:0" and "uuid":"00000000-0000-0000-0000-000000000000"

*) Delete all valid namespaces on all regions

ndctl destroy-namespace namespace0.0 or ndctl destroy-namespace -f all

*) Delete the region goal

ipmctl delete -goal

*) Reboot the host

systemctl reboot

*) Power off the host and install the new DCPMM (If the new DCPMM is already installed, you can skip this step)

systemctl poweroff

*) Create the new 'goal'

ipmctl create -goal PersistentMemoryType=AppDirect

*) Create the namespaces

ndctl list -R
ndctl create-namespace [options]
ccrhx4 commented 5 years ago

Thank you for the information by I failed to delete goal:

cmd > ipmctl delete -v -goal

NVM_DBG_LOGGER Debug NVDIMM-DBG:PbrOs.c::PbrDeserializeCtx:196: PBR MODE from shared memory: 0
NVM_DBG_LOGGER Debug NVDIMM-DBG:PbrOs.c::PbrDeserializeCtx:204: pbr_ctx.tmp not found, setting to default value
NVM_DBG_LOGGER Debug NVDIMM-DBG:Pbr.c::PbrInit:858: PbrInit PBR MODE: 0
NVM_DBG_LOGGER Debug NVDIMM-DBG:Pbr.c::PbrInit:859: PbrInit DONE
NVM_DBG_LOGGER Debug NvmDimmDriverDriverEntryPoint=0xf3a0df00 NVM_DBG_LOGGER Debug NVDIMM-DBG:NvmDimmDriver.c::NvmDimmDriverDriverEntryPoint:866: Exiting DriverEntryPoint, error = 0x0.
NVM_DBG_LOGGER Debug NvmDimmCliEntryPoint=0x00007f3af3990e90 NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimm:4958: Unable to initialize Intel NVM Dimm with custom GUID. Trying NVDIMM control region GUID NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimm:5016: No region found using custom GUID. Trying NVDIMM control region GUID NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimm:5072: IdentifyDimm data:
NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimm:5073: Raw Capacity (4k multiply): 33140816
NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimm:5084: String length is 21 NVM_DBG_LOGGER Debug NVDIMM-WARN:Dimm.c::InitializeDimm:5120: No NVDIMM region table found for block window on dimm: 0x20. NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimmInventory:1264: Insert NVDIMM Pid 0x26 to the initialized list NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimm:4958: Unable to initialize Intel NVM Dimm with custom GUID. Trying NVDIMM control region GUID NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimm:5016: No region found using custom GUID. Trying NVDIMM control region GUID NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimm:5072: IdentifyDimm data:
NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimm:5073: Raw Capacity (4k multiply): 33140816
NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimm:5084: String length is 21 NVM_DBG_LOGGER Debug NVDIMM-WARN:Dimm.c::InitializeDimm:5120: No NVDIMM region table found for block window on dimm: 0x120. NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimmInventory:1264: Insert NVDIMM Pid 0x33 to the initialized list NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimmInventory:1272: DIMM already in the Initialized list NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::InitializeDimmInventory:1272: DIMM already in the Initialized list NVM_DBG_LOGGER Debug NVDIMM-DBG:NvmDimmConfig.c::FillDimmList:8368: Found 2 DCPMMs NVM_DBG_LOGGER Debug NVDIMM-DBG:NvmDimmDriver.c::NvmDimmDriverDriverBindingStart:1421: Exiting DriverBindingStart, error = 0x0.
NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::GetPcdOemDataSize:2355: GetPcdOemDataSize. MaxOemDataSize: 604.
NVM_DBG_LOGGER Debug NVDIMM-DBG:PlatformConfigData.c::IsPcdCurrentConfHeaderValid:644: The data in Current Config table is valid. NVM_DBG_LOGGER Debug NVDIMM-DBG:Dimm.c::GetPcdOemDataSize:2355: GetPcdOemDataSize. MaxOemDataSize: 604.
NVM_DBG_LOGGER Debug NVDIMM-DBG:PlatformConfigData.c::IsPcdCurrentConfHeaderValid:644: The data in Current Config table is valid. NVM_DBG_LOGGER Debug NVDIMM-DBG:NvmSecurity.c::GetDimmSecurityState:59: PtReturnCode=0x0, FwReturnCode=0 NVM_DBG_LOGGER Debug NVDIMM-DBG:NvmSecurity.c::GetDimmSecurityState:59: PtReturnCode=0x0, FwReturnCode=0 NVM_DBG_LOGGER Debug NVDIMM-DBG:PlatformConfigData.c::IsPcdConfInputHeaderValid:574: The data in Config Input table is valid. NVM_DBG_LOGGER Debug NVDIMM-DBG:PlatformConfigData.c::IsPcdConfOutputHeaderValid:609: The data in Config Output table is valid. NVM_DBG_LOGGER Debug NVDIMM-DBG:Region.c::RetrieveGoalConfigsFromPlatformConfigData:1457: The config goal is already applied NVM_DBG_LOGGER Debug NVDIMM-DBG:PlatformConfigData.c::IsPcdConfInputHeaderValid:574: The data in Config Input table is valid. NVM_DBG_LOGGER Debug NVDIMM-DBG:PlatformConfigData.c::IsPcdConfOutputHeaderValid:609: The data in Config Output table is valid. NVM_DBG_LOGGER Debug NVDIMM-DBG:Region.c::RetrieveGoalConfigsFromPlatformConfigData:1457: The config goal is already applied Delete memory allocation goal from DIMM 0x0020: Error (122) - There is no goal configuration on DIMM. Delete memory allocation goal from DIMM 0x0120: Error (122) - There is no goal configuration on DIMM. NVM_DBG_LOGGER Debug NVDIMM-DBG:NvmDimmDriver.c::NvmDimmDriverDriverBindingStop:1841: Exiting DriverBindingStop, error = 0x0.
NVM_DBG_LOGGER Debug In U NVM_DBG_LOGGER Debug No recorded pointer(s) need FreePool. NVM_DBG_LOGGER Debug NVDIMM-DBG:PbrOs.c::SerializePbrMode:267: Writing to shared memory: 0
NVM_DBG_LOGGER Debug NVDIMM-DBG:NvmDimmDriver.c::NvmDimmDriverUnload:418: Exiting DriverUnload, error = 0x0.

kellycouch commented 5 years ago

'delete goal' is not a necessary step. In fact, it is only useful in case you have a pending goal request. Delete goal is used to remove a current goal request initiated by the 'create goal' command. After a goal request has been processed (after a reboot), there is no longer a goal request pending, but rather a new configuration is set. To change the configuration, you may use 'create goal' again and it will be processed on the next reboot.

ccrhx4 commented 5 years ago

Thank you for the clarification.

Is it a necessary step to delete region? I have used ndctl to disable all the regions but I do not see any option available to delete a region by ndctl or ipmctl.

sscargal commented 5 years ago

There is no concept of deleting a region. The system should always be in AppDirect, AppDirectInterleaved, or Memory Mode.

Also, it is not required to disable the region. To create the new region config, you do need to delete existing namespaces otherwise you'll get an EBUSY response. All you need to do is run ipmctl create -goal ... and reboot the host, then recreate namespaces (AppDirect* modes)

ccrhx4 commented 5 years ago

In other words, "create -goal" will be able to overwrite all the existing interleave set conf, is that right?

sscargal commented 5 years ago

Correct