??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó ßUdac @`sÝddlmZmZmZeZidd6dgd6dd6ZdZd Zd Z dd l Z y dd l Z dd l m Z Wne k r—eZnXeZdd lZdd lmZddlmZdZdZdZgZdddddddddddg ZdddddgZejeƒejeƒid d6d d6d d6d!d"6dd#6dd$6d%d&6Zd'efd(„ƒYZd)e fd*„ƒYZ!d+e fd,„ƒYZ"d-„Z#d.„Z$e%d/krÙe$ƒnd S(0i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust communityt supported_bys --- module: virt short_description: Manages virtual machines supported by libvirt description: - Manages virtual machines supported by I(libvirt). version_added: "0.2" options: name: description: - name of the guest VM being managed. Note that VM must be previously defined with xml. - This option is required unless I(command) is C(list_vms). state: description: - Note that there may be some lag for state requests like C(shutdown) since these refer only to VM states. After starting a guest, it may not be immediately accessible. state and command are mutually exclusive except when command=list_vms. In this case all VMs in specified state will be listed. choices: [ destroyed, paused, running, shutdown ] command: description: - In addition to state management, various non-idempotent commands are available. choices: [ create, define, destroy, freemem, get_xml, info, list_vms, nodeinfo, pause, shutdown, start, status, stop, undefine, unpause, virttype ] autostart: description: - start VM at host startup. type: bool version_added: "2.3" uri: description: - libvirt connection uri. default: qemu:///system xml: description: - XML document used with the define command. - Must be raw XML content using C(lookup). XML cannot be reference to a file. requirements: - python >= 2.6 - libvirt-python author: - Ansible Core Team - Michael DeHaan - Seth Vidal (@skvidal) s( # a playbook task line: - virt: name: alpha state: running # /usr/bin/ansible invocations # ansible host -m virt -a "name=alpha command=status" # ansible host -m virt -a "name=alpha command=get_xml" # ansible host -m virt -a "name=alpha command=create uri=lxc:///" # defining and launching an LXC guest - name: define vm virt: command: define xml: "{{ lookup('template', 'container-template.xml.j2') }}" uri: 'lxc:///' - name: start vm virt: name: foo state: running uri: 'lxc:///' # setting autostart on a qemu VM (default uri) - name: set autostart for a VM virt: name: foo autostart: yes # Defining a VM and making is autostart with host. VM will be off after this task - name: define vm from xml and set autostart virt: command: define xml: "{{ lookup('template', 'vm_template.xml.j2') }}" autostart: yes # Listing VMs - name: list all VMs virt: command: list_vms register: all_vms - name: list only running VMs virt: command: list_vms state: running register: running_vms sz # for list_vms command list_vms: description: The list of vms defined on the remote system type: list returned: success sample: [ "build.example.org", "dev.example.org" ] # for status command status: description: The status of the VM, among running, crashed, paused and shutdown type: str sample: "success" returned: success N(t libvirtError(t AnsibleModule(t to_nativeiitcreatetdefinetdestroytget_xmltpausetshutdowntstarttstoptundefinetunpausetfreememtinfotlist_vmstnodeinfotvirttypetrunningtpausediiitcrashedit VMNotFoundcB`seZRS((t__name__t __module__(((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR§stLibvirtConnectioncB`sÅeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(c C`sµ||_d}|jj|ƒ\}}}d|krHtjdƒ}nKd|kr„tjtjggdg}tj||ƒ}ntj|ƒ}|s¨tdƒ‚n||_ dS(Nsuname -rtxentesxshypervisor connection failure( tmodulet run_commandtlibvirttopentNonetVIR_CRED_AUTHNAMEtVIR_CRED_NOECHOPROMPTtopenAutht Exceptiontconn( tselfturiR#tcmdtrctstdouttstderrR,tauth((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyt__init__­s   c C`sÌ|j}g}|jƒ}x*|D]"}|j|ƒ}|j|ƒq"W|jƒ}x*|D]"}|j|ƒ}|j|ƒq[W|dkr‘|Sx$|D]}|jƒ|kr˜|Sq˜Wtd|ƒ‚dS(sM Extra bonus feature: vmid = -1 returns a list of everything iÿÿÿÿsvirtual machine %s not foundN(R,t listDomainsIDt lookupByIDtappendtlistDefinedDomainst lookupByNametnameR( R-tvmidR,tvmstidstidtvmtnamesR:((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pytfind_vmÁs        cC`s|j|ƒjƒS(N(RAR(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRÞscC`s |j|ƒS(N(tsuspend(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRáscC`s |j|ƒS(N(tresume(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRäscC`s|j|ƒjƒS(N(RARB(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRBçscC`s|j|ƒjƒS(N(RARC(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRCêscC`s|j|ƒjƒS(N(RAR (R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR íscC`s|j|ƒjƒS(N(RAR (R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR ðscC`s|j|ƒjƒS(N(RAR(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRóscC`s |jƒd}tj|dƒS(Nitunknown(RtVIRT_STATE_NAME_MAPtget(R-R?tstate((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyt get_status2öscC`s)|j|ƒjƒd}tj|dƒS(NiRD(RARRERF(R-R;RG((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyt get_statusúscC`s |jjƒS(N(R,tgetInfo(R-((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRþscC`s |jjƒS(N(R,tgetType(R-((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pytget_typescC`s|jj|ƒ}|jdƒS(Ni(R,R9tXMLDesc(R-R;R?((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRscC`s|jj|ƒ}|jƒS(N(R,R9tmaxVcpus(R-R;R?((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyt get_maxVcpusscC`s|jj|ƒ}|jƒS(N(R,R9t maxMemory(R-R;R?((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyt get_maxMemory scC`s |jjƒS(N(R,t getFreeMemory(R-((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRRscC`s|jj|ƒ}|jƒS(N(R,R9t autostart(R-R;R?((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyt get_autostartscC`s|jj|ƒ}|j|ƒS(N(R,R9t setAutostart(R-R;tvalR?((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyt set_autostartscC`s|jj|ƒS(N(R,t defineXML(R-txml((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pytdefine_from_xmls(RRR4RARRRRBRCR R RRHRIRRLRRORQRRRTRWRZ(((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR «s*                    tVirtcB`sÑeZd„Zd„Zd„Zd„Zd„Zd„Zdd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cC`s||_||_dS(N(R#R.(R-R.R#((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR4!s cC`st|j|jƒ|_|jS(N(R R.R#R,(R-((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyt __get_conn%scC`s|jƒ|jj|ƒS(N(t_Virt__get_connR,RA(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pytget_vm)s cC`sP|jƒ}g}x7|D]/}|jj|ƒ}|jd||fƒqW|S(Ns%s %s(RR,RIR7(R-R<RGR?t state_blurb((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRG-s   cC`s±|jƒ}tƒ}x•|D]}|jj|ƒjƒ}tdtj|ddƒdt|dƒdt|dƒd|d d t|d ƒd |jj|ƒƒ|||jj||ƒtStS(N(R]R,RTRWtTruetFalse(R-R;tas_flag((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRSls cC`s|jƒ|_|jjƒS(N(R]R,RR(R-((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRuscC`s|jƒ|jj|ƒdS(sK Make the machine with the given vmid stop running. Whatever that takes. i(R]R,R(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRys cC`s|jƒ|jj|ƒS(s) Pause the machine with the given vmid. (R]R,RB(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRs cC`s|jƒ|jj|ƒS(s+ Unpause the machine with the given vmid. (R]R,RC(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR…s cC`s|jƒ|jj|ƒS(s& Start the machine via the given vmid (R]R,R (R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR ‹s cC`s|jƒ|jj|ƒS(s) Start the machine via the given id/name (R]R,R (R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR‘s cC`s|jƒ|jj|ƒS(sf Pull the virtual power from the virtual domain, giving it virtually no time to virtually shut down. (R]R,R (R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR —s cC`s|jƒ|jj|ƒS(sX Stop a domain, and then wipe it from the face of the earth. (delete disk/config file) (R]R,R(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRœs cC`s|jƒ|jj|ƒS(sg Return a state suitable for server consumption. Aka, codes.py values, not XM output. (R]R,RI(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR¢s cC`s|jƒ|jj|ƒS(sp Receive a Vm id as input Return an xml describing vm config returned by a libvirt call (R]R,R(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR©s cC`s|jƒ|jj|ƒS(s9 Gets the max number of VCPUs on a guest (R]R,RO(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyRO²s cC`s|jƒ|jj|ƒS(s0 Gets the max memory on a guest (R]R,t get_MaxMemory(R-R;((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pytget_max_memoryºs cC`s|jƒ|jj|ƒS(s3 Define a guest with the given xml (R]R,RZ(R-RY((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR Âs N(RRR4R]R^RGRRR'RRRSRRRRR RR RRRRORvR (((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyR[s,                   cC`s`|jjddƒ}|jjddƒ}|jjddƒ}|jjddƒ}|jjddƒ}|jjddƒ}t||ƒ}tƒ}|rã|dkrã|jd|ƒ}t|tƒsÙi||6}nt|fS|dk r~|dkr~|s|jd d ƒny|j |ƒWn%t k rL|jd d |ƒnX|j ||ƒ|d <| r~| r~t|fSn|rü|s|jd d ƒn|dkr|j |ƒdkrÞt |d <|j|ƒ|d (.*)is#Could not find domain 'name' in xmlsconfig changedt change_reasontcreatedi slibvirtError: %ss%s requires 1 argument: guestsCommand %s not recognizeds3expected state or command parameter to be specified( tparamsRFR'R[RdRt isinstancet VIRT_SUCCESSt fail_jsonR^RRSRRrRRRR Rt VM_COMMANDStwarntretsearchtgroupsR RMR:Rtget_error_codetmessagetgetattrthasattr(R#RGRStguestRwR.RYtvtrest found_namet domain_nametexisting_domaintdomainte((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pytcoreÊs¬                      cC`s6tdtdtddddgƒdtdddd d d d gƒd tddƒdtdddtƒdtddddƒdtddƒƒƒ}ts¬|jddƒnt}yt|ƒ\}}Wn5tk rÿ}|jdt|ƒdt j ƒƒnX|dkr%|jd|d|ƒn |j |dS(Nt argument_specR:ttypeRetaliasesRŠRGtchoicesRzRRRRStboolRwR.tdefaultsqemu:///systemRYRxs?The `libvirt` module is not importable. Check the requirements.t exceptioniR0( R Rdt ALL_COMMANDStHAS_VIRTR€RR’R+R t tracebackt format_exct exit_json(R#R0tresultR‘((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pytmain@s$!& t__main__(&t __future__RRRR”t __metaclass__tANSIBLE_METADATAt DOCUMENTATIONtEXAMPLEStRETURNRœR%Rt ImportErrorRsR›RrRƒtansible.module_utils.basicR tansible.module_utils._textR t VIRT_FAILEDRtVIRT_UNAVAILABLERšRt HOST_COMMANDStextendRER+RtobjectR R[R’R R(((sC/usr/lib/python2.7/site-packages/ansible/modules/cloud/misc/virt.pyt sP   /1     '   t« v