Monday, 2026-06-22

opendevreviewchandan kumar proposed openstack/cyborg-specs master: Add generic NVMe driver spec with secure cleanup  https://review.opendev.org/c/openstack/cyborg-specs/+/98534906:09
chandankumarsean-k-mooney: Hello09:44
sean-k-mooneyo/09:44
chandankumarI wanted to discuss about nvme cleanup fallback strategy.09:44
chandankumarIn previous draft spec, we were checking whether the driver supports which of the cleaning strategy: nvme sanitize (CES, BES, OWS) or nvme format(SES2, SES1). If not then we can move it shred or dd. But shred or dd is not gurantee secure erase.09:44
chandankumarSince In libvirt emuluted nvme, it supports SES2 and SES1. SES2 performs cypto erase09:44
chandankumarIt is the last cleaning strategy available for testing right now in our emulated env.09:44
sean-k-mooneysecure erase is not the goal09:45
chandankumarHere is what I was thinking about new cleanup strategy:09:45
sean-k-mooneycleaning is09:45
chandankumarnvme sanitize (CES, BES, OWS) then nvme format(SES2) if not supported then move the device to error state and let' operator decide what to do that.09:45
sean-k-mooneyno09:45
sean-k-mooneyeither we only suprpot device with sanitize09:45
sean-k-mooneyor we have a fallback that works for all devices09:46
sean-k-mooneybut its not ok for use to provision a device to a vm that we cant clean09:46
sean-k-mooneywe coudl use nvme format09:46
sean-k-mooneybut if the device will alwasy end up in error then we shoudl not allow ti to be managed by cybrog09:46
sean-k-mooneyalso while we can have teird cleaning levels we should not fallback at runtime09:47
sean-k-mooneywe shoudl discover the clenaing supprot level and or allow specify the cleaning mode via the config but we shoudl only attpemt one method of cleaning in the runtime path09:48
sean-k-mooneyshread/dd woudl jusut overrite the entirly block device if we use that path09:49
sean-k-mooneythat is what we do for lvm volumes in cidner and nova09:49
chandankumarNot all devices support nvme format also09:50
sean-k-mooneyright which is why im not really that intersted in supproting that09:50
sean-k-mooneydd/sheread is a universal method that will work its just slow and consumes a full driver write cycle09:50
chandankumarin that case, we have two options 1. use fallback as shread or dd (just like nova or cinder) or 2. provide cleanup method via config09:51
chandankumarBut if we pass the cleanup method via config, how os-triats will report to placement here09:51
sean-k-mooneywe woudl filter the triat based on the selected cleanup method09:52
chandankumarif it might be something else other than snaitize or dd/shread09:52
sean-k-mooneyit wont be arbaitary09:52
sean-k-mooneyit would be and enuma of  "sanitize", "format" or "zero"09:53
sean-k-mooneyzero beign shread or dd09:53
chandankumarok, in that case it will work09:53
sean-k-mooneyi have no interest in allowing oeprator to pass a cleaning command09:54
sean-k-mooneythat is a security nightmare so while i am ok with them chooing a policy09:55
sean-k-mooneyim not ok with giving them free rain to plug in anything they want fro the cleaning command09:55
sean-k-mooneywe can also supprot an auto value as the default09:55
sean-k-mooneywhere we will use the best/fasted method the device supprots09:56
chandankumaryes, that source better09:56
sean-k-mooneyso the config option (in the device-spec) would not be required its just an overried if the operaotr need to set it for soem reason i.e. there device is buggy09:56
chandankumarso the cleanup option would be auto, santitize, format, zero09:57
sean-k-mooneyyep i think that woudl work again we can decied if we want to suprpot format or not09:57
sean-k-mooneybut that somethign we can refine at implemation time09:58
chandankumarperfect09:58
sean-k-mooneyhow common is it that sanatize is not supproted these days09:58
sean-k-mooneymost read intensive ssd are rated at 1 total drive write per day DWPD wer as mixed use drives are rated at 10 adn write intensive deves at 25+09:59
sean-k-mooneyso on a moder driver just zeroing it with dd/shred is not terible for the lifetime of the drive10:00
sean-k-mooneyand if your passing a drive to a vm they can do that anyway10:00
sean-k-mooneyso i think having "zero" as the work for anything fallback is fine for legacy drives but i suspect almost everyting will work with on eof the sanitize levels10:01
sean-k-mooneywe could also looks at blockdiscard/trim but we can dicuss that later when it comes to reiving the zero implemation10:03
chandankumarnvme sanitize was added nvme 1.3 specification, these days most of the nvme device comes with nvme 2.0 10:04
chandankumarit should have sanitize10:04
sean-k-mooneyright that my thinkign as well10:04
chandankumarThe I have in my laptop have , it does not support cyrpot erase10:05
chandankumarBlock Erase Sanitize Operation Supported10:05
sean-k-mooneyya so again cyrpto erase is nice to have but not required10:06
sean-k-mooneyif you want encypted storage you should just add luks on top of the nvme device in the gust10:07
sean-k-mooneyan not rely on the device cleaning to do that for you10:07
chandankumaryes adding luks wuld do the job10:08
chandankumarlet me update the spec based on above discussion10:08
chandankumarthank you!10:08
sean-k-mooneymy intuition is to just supprot sanatize and zero by the way10:08
sean-k-mooneyand skip format entirly10:08
sean-k-mooneyi do not like that format only works on the first namespace10:09
sean-k-mooneyor if a namespace still exists10:09
chandankumarsure, I will drop format10:10
sean-k-mooneycool any other question on any of the feedback i left on the spec?10:11
sean-k-mooneyill try and do anohter full pass over it in the next day or two10:11
chandankumarnope rest of them I have address10:11
chandankumarI will try to get it updated by eod or tomorrow morning10:11
sean-k-mooneycool ill plan to take a look tomorow or wednesday so10:12
sean-k-mooneyassuming there are no other issues and we are mostly aligned we will probly merge it end ro week or early next week10:12
chandankumarsounds good10:18
sean-k-mooneyso thinking about this i wonder if cypto erase need to be configurable. the block erase version of sanitize and format is actully more secure then cypto erase alone 10:26
sean-k-mooneyso we could consider 2 tuneable 10:26
sean-k-mooneyclear_mode=block|crypto clear_method=sanatize|zero10:27
sean-k-mooneyclear_mode=block|crypto|auto clear_method=sanatize|zero|auto10:28
sean-k-mooneychandankumar: it really is 2 seperate question so i think that might be a better way to model it10:28
sean-k-mooneychandankumar: apprenly there is also a nvme write-zeroes command10:29
sean-k-mooneychandankumar: so we can use that instead of dd or shred for the zero fallback if supproted10:29
chandankumaryes, The Write Zeroes command is used to set a range of logical blocks to zero.10:30
sean-k-mooneyyep but it can zeor the entire device and its doe by the cornoler rather then the cpu10:31
sean-k-mooneyso in zero mode waht we could do is delete all namespace, create 1 namespace that cover the entire device and then zero it with write-zeors10:32
sean-k-mooneyi also think we need to do that namespace reset in general10:32
sean-k-mooneyso as part of cleaning we will need to ensure we have restored teh defivce to havign 1 namespace that uses the entire device10:32
sean-k-mooneyin case the tenatn had reconfigured it to soemthing else10:33
chandankumarsudo nvme id-ctrl /dev/nvme0n1 -H | grep -A 10 "oncs" 10:34
chandankumaroncs      : 0xdf10:34
chandankumar  [12:12] : 0 Namespace Zeroes Not Supported10:34
chandankumar  [11:11] : 0 Maximum Write Zeroes with Deallocate Not Supported10:34
chandankumar  [10:10] : 0 All Fast Copy Not Supported10:34
chandankumar  [9:9] : 0 Copy Single Atomicity Not Supported10:34
chandankumar  [8:8] : 0 Copy Not Supported10:34
chandankumar  [7:7] : 0x1 Verify Supported10:34
chandankumar  [6:6] : 0x1 Timestamp Supported10:34
chandankumar  [5:5] : 0 Reservations Not Supported10:34
chandankumar  [4:4] : 0x1 Save and Select Supported10:35
chandankumar  [3:3] : 0x1 Write Zeroes Supported10:35
chandankumarLet me read about this one10:36
chandankumarcurrent spec does not focus on namespace. 10:42
sean-k-mooneyright that a gap we need to adress10:43
chandankumarwe need retrive all the namespace from the contoller, then delete all of them and create single namespace then perform nvme write zero10:43
chandankumarDo we need to do it in the same one? Do a follow up on that?10:43
chandankumaror just make a note, follow up during implementation 10:44
sean-k-mooneythis need to be done in this spec10:47
sean-k-mooneynot as a followup10:47
chandankumarok10:48
sean-k-mooneywe need to ensure we provide the deivce in a standarized repoducabel state10:48
sean-k-mooneyregardless of what the previous user did to it10:48
sean-k-mooneyso 1 namespace for the entire device, cleared or previosu content and we shoudl likely also ensure that there are no encyption keys present but that might be somethign we can defer to the implemeation10:49
chandankumarfor sanitize, we donot need to worry about namespace, for write zeros, we can pull the namespace, delete all ns and create one, perform write zero10:53
chandankumarone more question10:53
chandankumarregarding config option, clear_mode=block, clear_method=sanitize, you have used pipe to specify all the option here just for example10:55
sean-k-mooneyyep that just me showitn the options of the enum10:55
chandankumarok, got it10:55
sean-k-mooneyso this is a summary of what iw was tahttign to you about with ai https://paste.opendev.org/show/bDKh5ZaFcfOv7lDGlLer/10:56
chandankumarah good, I did not thought about passing via device_spec10:58
sean-k-mooneyi gave it your latest spec draft and asked it to codify the options we were discusion into a new section that you could include10:58
sean-k-mooneywell we need to set this per device10:59
sean-k-mooneyso that the simpler way to do that10:59
chandankumaryup, it is much simpler10:59
sean-k-mooneywe may consider allowign this as a atibute via the api in the future10:59
sean-k-mooneybut for now lets keep it simple10:59
sean-k-mooneyhttps://paste.opendev.org/show/bDKh5ZaFcfOv7lDGlLer/ is not entirly correct in that cyborg wont do any driver binding11:00
sean-k-mooneythat shoudl happen when the qemu isntance is stopped/deleted by libvirt automaticlly11:01
sean-k-mooneythis is assuming managed=yes semantics11:01
sean-k-mooneyso cyborg will assume that we can just use nvmcli witht hedefivce and we cna declare all device driver binding out of scope11:02
sean-k-mooneyotherwise that sumamry is close to what i woudl write in the spec11:02

Generated by irclog2html.py 4.1.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!