move code from parser to function _clone_diskconfig()