+ def needed_sysprep_params(self):
+ """Returns a list of needed sysprep parameters. Each element in the
+ list is a SysprepParam object.
+ """
+
+ password = self.SysprepParam(
+ 'password', 'Image Administrator Password', 20, lambda x: True)
+
+ return [password]
+
+ @sysprep(enabled=True)
+ def disable_ipv6_privacy_extensions(self, print_header=True):
+ """Disable IPv6 privacy extensions"""
+
+ if print_header:
+ self.out.output("Disabling IPv6 privacy extensions")
+
+ out, err, rc = self._guest_exec(
+ 'netsh interface ipv6 set global randomizeidentifiers=disabled '
+ 'store=persistent')
+
+ if rc != 0:
+ raise FatalError("Unable to disable IPv6 privacy extensions: %s" %
+ err)
+
+ @sysprep(enabled=True)
+ def microsoft_sysprep(self, print_header=True):
+ """Run the Micorsoft System Preparation Tool on the Image. After this
+ runs, no other task may run.
+ """
+
+ if print_header:
+ self.out.output("Executing sysprep on the image (may take more "
+ "than 10 minutes)")
+
+ out, err, rc = self._guest_exec(r'C:\windows\system32\sysprep\sysprep '
+ r'/quiet /generalize /oobe /shutdown')
+ self.syspreped = True
+ if rc != 0:
+ raise FatalError("Unable to perform sysprep: %s" % err)