基本信息
源码名称:Libvirt_Application_Development_Guide_Using_Python-en-US
源码大小:0.80M
文件格式:.pdf
开发语言:Python
更新时间:2020-01-07
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

Preface ix
1. Document Conventions ................................................................................................... ix
1.1. Typographic Conventions ..................................................................................... ix
1.2. Pull-quote Conventions ......................................................................................... x
1.3. Notes and Warnings ............................................................................................ xi
2. We Need Feedback! ....................................................................................................... xi
1. Introduction 1
1.1. Overview ..................................................................................................................... 1
1.2. Glossary of terms ......................................................................................................... 1
2. Architecture 3
2.1. Object model ............................................................................................................... 3
2.1.1. Hypervisor connections ...................................................................................... 3
2.1.2. Guest domains .................................................................................................. 3
2.1.3. Virtual networks ................................................................................................. 4
2.1.4. Storage pools .................................................................................................... 4
2.1.5. Storage volumes ............................................................................................... 5
2.1.6. Host devices ..................................................................................................... 5
2.2. Driver model ................................................................................................................ 6
2.3. Remote management ................................................................................................... 7
2.3.1. Basic usage ...................................................................................................... 7
2.3.2. Data Transports ................................................................................................. 8
2.3.3. Authentication schemes ..................................................................................... 9
2.4. Generating TLS certificates ........................................................................................... 9
2.4.1. Public Key Infrastructure setup ......................................................................... 10
3. Connections 11
3.1. Overview .................................................................................................................... 11
3.1.1. open ............................................................................................................... 11
3.1.2. openReadOnly ................................................................................................. 12
3.1.3. openAuth ........................................................................................................ 12
3.1.4. close ............................................................................................................... 13
3.2. URI formats ............................................................................................................... 14
3.2.1. Local URIs ...................................................................................................... 14
3.2.2. Remote URIs .................................................................................................. 15
3.3. Capability Information Methods ................................................................................... 17
3.4. Host information ......................................................................................................... 21
3.4.1. getHostname ................................................................................................... 21
3.4.2. getMaxVcpus ................................................................................................... 21
3.4.3. getInfo ............................................................................................................. 22
3.4.4. getCellsFreeMemory ........................................................................................ 23
3.4.5. getType ........................................................................................................... 23
3.4.6. getVersion ....................................................................................................... 24
3.4.7. getLibVersion ................................................................................................... 24
3.4.8. getURI ............................................................................................................ 25
3.4.9. isEncrypted ..................................................................................................... 25
3.4.10. isSecure ........................................................................................................ 25
3.4.11. isAlive ........................................................................................................... 26
3.4.12. compareCPU ................................................................................................. 26
3.4.13. getFreeMemory ............................................................................................. 27
3.4.14. getFreePages ................................................................................................ 27
3.4.15. getMemoryParameters ................................................................................... 28
Libvirt Application Development Guide Using Python Draft
vi
3.4.16. getMemoryStats ............................................................................................. 28
3.4.17. getSecurityModel ........................................................................................... 29
3.4.18. getSysinfo ..................................................................................................... 29
3.4.19. getCPUMap ................................................................................................... 30
3.4.20. getCPUStats .................................................................................................. 30
3.4.21. getCPUModelNames ...................................................................................... 30
4. Guest Domains 33
4.1. Domain Overview ....................................................................................................... 33
4.2. Listing Domains .......................................................................................................... 34
4.3. Obtaining State Information About a Domain ................................................................ 37
4.3.1. Fetching the ID of a domain ............................................................................. 37
4.3.2. Fetching the UUID of a domain ........................................................................ 37
4.3.3. Fetching the OS type of a domain .................................................................... 38
4.3.4. Determining if the domain has a current snapshot .............................................. 38
4.3.5. Determining if the domain has managed save images ........................................ 39
4.3.6. Fetch the hostname of the domain ................................................................... 39
4.3.7. Get the Domain hardware info .......................................................................... 40
4.3.8. Determine if the Domain is running ................................................................... 41
4.3.9. Determine if the Domain is persistent ............................................................... 41
4.3.10. Determine if the Domain is updated ................................................................ 42
4.3.11. Determine the max memory of the Domain ...................................................... 42
4.3.12. Determine the max Vcpus of the Domain ........................................................ 43
4.3.13. Fetch the name of the Domain ....................................................................... 43
4.3.14. Fetch the state of the Domain ........................................................................ 44
4.3.15. Extract the time information from Domain ........................................................ 45
4.4. Lifecycle Control ......................................................................................................... 45
4.4.1. Provisioning and Starting ................................................................................. 46
4.4.2. Stopping .......................................................................................................... 53
4.4.3. Suspend / Resume and Save / Restore ............................................................. 53
4.4.4. Migration ......................................................................................................... 55
4.4.5. Autostart ......................................................................................................... 58
4.5. Domain Configuration ................................................................................................. 58
4.5.1. Boot Modes ..................................................................................................... 58
4.5.2. Memory / CPU Resources ................................................................................ 59
4.6. Monitoring Performance .............................................................................................. 60
4.6.1. Domain Block Device Performance ................................................................... 60
4.6.2. vCPU Performance .......................................................................................... 61
4.6.3. Memory Statistics ............................................................................................ 62
4.6.4. I/O Statistics .................................................................................................... 63
4.7. Device configuration ................................................................................................... 63
4.7.1. Emulator ......................................................................................................... 64
4.7.2. Disks ............................................................................................................... 65
4.7.3. Networking ...................................................................................................... 66
4.7.4. Mice, Keyboard & Tablets ................................................................................ 67
4.7.5. USB Device Passthrough ................................................................................. 68
4.7.6. PCI device passthrough ................................................................................... 68
4.8. Live Configuration Change .......................................................................................... 69
4.8.1. Block Device Jobs ........................................................................................... 69
5. Storage Pools 71
5.1. Overview .................................................................................................................... 72
Draft
vii
5.2. Listing pools ............................................................................................................... 72
5.3. Pool usage ................................................................................................................ 73
5.4. Lifecycle control ......................................................................................................... 74
5.5. Discovering pool sources ............................................................................................ 75
5.6. Pool configuration ....................................................................................................... 76
5.7. Volume overview ........................................................................................................ 77
5.8. Listing volumes .......................................................................................................... 77
5.9. Volume information ..................................................................................................... 77
5.10. Creating and deleting volumes .................................................................................. 78
5.11. Cloning volumes ....................................................................................................... 79
5.12. Configuring volumes ................................................................................................. 80
6. Virtual Networks 83
6.1. Overview .................................................................................................................... 83
6.2. Listing networks ......................................................................................................... 83
6.3. Lifecycle control ......................................................................................................... 84
6.4. Network configuration ................................................................................................. 85
7. Network Interfaces 87
7.1. Overview .................................................................................................................... 87
7.2. XML Interface Description Format ............................................................................... 87
7.3. Retrieving Information About Interfaces ....................................................................... 88
7.3.1. Enumerating Interfaces .................................................................................... 88
7.3.2. Obtaining a virInterface instance for an Interface ............................................... 89
7.3.3. Retrieving Detailed Interface Information ........................................................... 90
7.3.4. Retrieving Interface Network Addresses ............................................................ 91
7.4. Managing interface configuration files .......................................................................... 91
7.4.1. Defining an interface configuration .................................................................... 92
7.4.2. Undefining an interface configuration ................................................................ 92
7.4.3. changeRollback ............................................................................................... 93
7.4.4. changeBegin ................................................................................................... 93
7.4.5. changeCommit ................................................................................................ 94
7.5. Interface lifecycle management ................................................................................... 94
7.5.1. Activating an interface ...................................................................................... 94
7.5.2. Deactivating an interface .................................................................................. 94
8. Error Handling 97
8.1. virGetLastError ......................................................................................................... 101
8.2. Subclassing libvirtError ............................................................................................. 102
8.3. Registering an Error Handler Function ....................................................................... 102
9. Event and Timer Handling 105
9.1. Event Handling ......................................................................................................... 105
9.2. Timer Handling ......................................................................................................... 106
10. Security Model 109
11. Debugging / Logging 111
11.1. Environment Variables ............................................................................................. 112
A. Revision History 113
Index 115