ó i'dWc@sWdZddlZddlZddlZddlZddljZddlmZm Z ddl m Z m Z m Z mZmZmZmZmZddlmZmZmZddlmZmZddlmZddlmZdd lmZdd l m!Z!dd l"m#Z#m$Z$d „Z%d „Z&d„Z'e d„ƒZ(e)d„Z*dS(s archiveadm create iÿÿÿÿN(t OptionGroupt SUPPRESS_HELP(tApplicationDatat with_spinnert_tLockfilet LockfileErrort SetUIDasEUIDtsystem_temp_pathtCalledProcessError(tUnifiedArchivetLOGFILEtutil(t spinwritet ArchiveError(t InstallEngine(tES_DATA_EXCEPTION(tINSTALL_LOGGER_NAME(tTarget(tLogicaltZpoolcCs tdƒS(NsË create [-z|--zone ] [-D|--exclude-dataset ] [-Z|--exclude-zone ] [-r|--recovery] [-e|--exclude-media] [-s|--skip-capacity-check] [--root-only] (R(((s create.pyt get_usage0sc Csàt|ddƒ}|jdddddddtd ƒƒ|jd ddddƒ|jd d dddd dtdƒƒ|jddddd ƒ|jdddddddtdƒƒ|jdddddƒ|jdddddddtdƒƒ|jdddddddtdƒƒ|jdddddd dtd!ƒƒ|jd"dddd#dtd$ƒƒ|jd%dddd&dtƒ|jd'dddd(dtƒ|jd)dddd*dtƒ|j|ƒdS(+NsArchive Creation Optionss-zs--zonetactiontextendtdesttzonesthelpsone or more zones to includes--zoness-Zs--exclude-zonet exclude_zonessone or more zones to excludes--exclude-zoness-Ds--exclude-datasett exclude_dssone or more datasets to excludes--exclude-datasetss-rs --recoveryt store_truetrecoverys%create a full system recovery archives-es--exclude-mediat exclude_mediasexclude embedded install medias-ss--skip-capacity-checkt skip_checks$skip the staging area capacity checks --root-onlyt root_onlyscreate archive with root onlys--mock-streamst mock_streamss --mock-mediat mock_medias--prepare-onlyt prepare_only(RtNonet add_optionRRtadd_option_group(tparsertgroup((s create.pyt setup_options<s<          c Csptjtƒ}|jdƒ|d}tj|ddƒ}|jdkr_ttdƒƒ‚n|j}t jj |ƒ}|j d dƒj ƒs§ttdƒƒ‚nt|ƒdkrÎttd ƒƒ‚nt jj|ƒ}t jj|ƒr ttd ƒ|ƒ‚ntƒKt jt jj|ƒt jƒs[ttd t jj|ƒƒƒ‚nWd QX|jrˆ|jrˆttd ƒƒ‚n|jrÇ|jrÇt|jƒdkrÇttdƒƒ‚qÇn|jr$|jrîttdƒƒ‚n|jr$t|jƒdkr$ttdƒƒ‚q$n|jd k rnx8|jD]*}|jdƒr=ttdƒƒ‚q=q=Wni}||d<|j|d<|j|d<|j|d<|jr»d|dNOTICE: ZFS pool '%(pool)s' in unsupported state: %(state)s' tpooltstates%archiveadm create: unable to continuetTargetDiscoverys solaris_install/target/discoverytsetuidtnametInitializeUnifiedArchives#solaris_install/archive/checkpointss Unified Archive initialized: %s R.sLogging to: %s tDatasetDiscoverysExecuting dataset discovery... sDataset discovery complete tglobals kernel-zones1Unabled to verify archive portability, continuings|NOTICE: The following packages are not installed and may cause archive portability issues with some platform components: %s s RtCreateZoneMedias&Creating install media for zone(s)... sMedia creation complete tPrepareArchiveImages"Preparing archive system image... R$sqArchive image preparation complete. Please destroy the archive BE referenced above once verification is complete.tCreateArchiveStreamss%Beginning archive stream creation... s!Archive stream creation complete tCreateArchiveDescriptortAssembleUnifiedArchives$Beginning final archive assembly... sArchive creation complete (RQRR(&Rt get_instancetdoctvolatiletget_first_childRt data_dictR RtFalseR tget_all_zpoolstget_zpool_healthtTrueR;tregister_checkpointt_execute_checkpointstversaboot_enabledt get_boot_poolt persistentRt DISCOVEREDRt get_childrenRRWt delete_zpoolR R tarchive_objectstzonetsystemt system_typetlist_missing_platform_supportR tjointgetR%( RMtengineRatunsupported_poolsRSRTt boot_pooltlogicaltzpoolstzpooltuatarchive_objecttmissing((s create.pyRCºs                        c Cs•|r+tƒ|jƒ\}}WdQXn|jƒ\}}|tjkr‘tjtƒ}t}d}x…|D]}}xtt j |ƒD]c}|j d|ƒ|j t } |j d| ƒt| tƒrÏ| }nt| tƒr„t}q„q„WqnW|jjjdtƒ} | dk r0ttdƒƒ| jƒn|rEtdƒ‚q‘|dk rxttdƒi|d6td6ƒ‚q‘ttd tƒƒ‚ndS( Ns%s checkpoint faileds%sRPs5Cleaning up archive creation resources, please wait. tsMArchive creation failed: %(err)s. See %(log)s on the host system for details.terrtlogs,Archive creation failed, see %s for details.(Rtexecute_checkpointsRt EXEC_SUCCESSR1R2R3ReR%terrsvctget_errors_by_mod_idR4t error_dataRt isinstanceRtKeyboardInterruptRhRaRbRcR R Rt abort_createR;R ( RxRVtstatust failed_cpsRItcontrolct archive_errort failed_cpR‚RNR~((s create.pyRj=s8         (+t__doc__R1R7RDR5tsolaris_install.errsvcR†toptparseRRtsolaris_installRRRRRRRR tsolaris_install.archiveR R R tsolaris_install.archive.utilR Rtsolaris_install.engineRRtsolaris_install.loggerRR3tsolaris_install.targetRtsolaris_install.target.logicalRRRR*RORCReRj(((s create.pyts&    : ' Wƒ