Activity log for bug #1407842

Date Who What changed Old value New value Message
2015-01-06 02:04:30 Hao Li bug added bug
2015-01-06 02:14:15 Hao Li description I have read cloudbase-init source code, I found it will work until "HKEY_LOCAL_MACHINE\\SYSTEM\\Setup\\Status\\SysprepStatus" is 7. This may be cause some problem: sysprep process: finish making image,then run sysprep.exe /oobe /generalize /shutdown /unattend:path-------->boot instance from this image----->sysprep will work(find device,and install device driver,then set SysprepStatus 7)------------>sysprep do other things,then reboot vm--------->finish user settings------->login interface because I have installed cloudbase-init, it start when SysprepStatus is 7, In this moment, sysprep is working and cloudbase-init is working too, when cloudbase-init finish running sethostname plugin, it will reboot vm, but this moment, sysprep is doing important system setting. So the VM will crash. I propose a way to solve this problem, set a flag in a flag_file, if flag_file is not exist or the content is 0, cloudbase-init should not run. set the flag 1, and cloudbase-init stop. if flag is 1, It can work. I have modify the source code: def wait_for_boot_complete(self): path = CONF.sysprep_status_path print path is_exist = os.path.exists(path) if not is_exist: try: fp = os.open(path, os.O_CREAT | os.O_RDWR) os.write(fp, "1") except Exception, e: LOG.warning(e) finally: os.close(fp) return -1 else: try: fp = os.open(path, os.O_RDWR) data = os.read(fp, 1) except Exception, e: LOG.warning(e) return -1 if data == "0": os.lseek(fp,0,0) os.write(fp, "1") os.close(fp) return -1 else: os.close(fp) I have read cloudbase-init source code, I found it will work until "HKEY_LOCAL_MACHINE\\SYSTEM\\Setup\\Status\\SysprepStatus" is 7. This may be cause some problem: sysprep process:  finish making image,then run sysprep.exe /oobe /generalize /shutdown /unattend:path-------->boot instance from this image----->sysprep will work(find device,and install device driver,then set SysprepStatus 7)------------>sysprep do other things,then reboot vm--------->finish user settings------->login interface because I have installed cloudbase-init, it start when SysprepStatus is 7, In this moment, sysprep is working and cloudbase-init is working too, when cloudbase-init finish running sethostname plugin, it will reboot vm, but this moment, sysprep is doing important system setting. So the VM will crash. environment: vm: windows 2012 R2 64bit, installed cloudbase-init (2014.12.08) host: RHEL 6.4 64bit I propose a way to solve this problem, set a flag in a flag_file, if flag_file is not exist or the content is 0, cloudbase-init should not run. set the flag 1, and cloudbase-init stop. if flag is 1, It can work. I have modify the source code: def wait_for_boot_complete(self):         path = CONF.sysprep_status_path         print path         is_exist = os.path.exists(path)         if not is_exist:             try:                 fp = os.open(path, os.O_CREAT | os.O_RDWR)                 os.write(fp, "1")             except Exception, e:                 LOG.warning(e)             finally:                 os.close(fp)             return -1         else:             try:                 fp = os.open(path, os.O_RDWR)                 data = os.read(fp, 1)             except Exception, e:                 LOG.warning(e)                 return -1             if data == "0":                 os.lseek(fp,0,0)                 os.write(fp, "1")                 os.close(fp)                 return -1             else:                 os.close(fp)
2015-01-09 11:27:08 Alessandro Pilotti cloudbase-init: assignee Adrian Vladu (avladu)
2015-01-20 13:19:29 Alessandro Pilotti cloudbase-init: status New Incomplete
2015-03-07 20:14:54 Curt Moore attachment added cloudbase-init.log https://bugs.launchpad.net/cloudbase-init/+bug/1407842/+attachment/4337425/+files/cloudbase-init.log
2015-03-07 20:15:30 Curt Moore attachment added sysprep error dialog https://bugs.launchpad.net/cloudbase-init/+bug/1407842/+attachment/4337426/+files/sysprep_error.png
2016-04-08 07:31:17 Iwao Endo cloudbase-init: status Incomplete Opinion
2016-04-08 11:36:41 Iwao Endo cloudbase-init: status Opinion Incomplete