摘要: 知识点:通过判断/var/run/xapi_init_complete.cookie 文件是否存在来确定xapi是否初始化完成。 阅读全文
posted @ 2017-12-13 13:40 hayden__wang 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 1. 问题一:如何判断一个VM已启动完成?有时候需要统计一台xenserver上所有的VM启动起来花了多长时间 参考链接:http://xapi-project.github.io/xen-api/usage.html 具体如果实现再研究。 2. 问题二:用命令行关闭一个虚拟机,如何判断虚拟机已经完 阅读全文
posted @ 2017-12-12 18:19 hayden__wang 阅读(215) 评论(0) 推荐(0) 编辑
摘要: lambda: map 阅读全文
posted @ 2017-12-12 17:33 hayden__wang 阅读(110) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3 # -*- coding: utf-8 '''循环(loop) 迭代(iterate) 递归(recursion) 遍历(traversal) 斐波那契数列 ''' a, b = 0, 1 for i in range(4): a, b = b, a+b print(a) def fibs(n): '''这是一个Fibon... 阅读全文
posted @ 2017-12-12 13:30 hayden__wang 阅读(234) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- '''去除多余的空格 ''' string = "My name is hyaden" print(string) str_list = string.split(" ") print(str_list) words1 = [ s.strip() for s in str_list] #... 阅读全文
posted @ 2017-12-11 14:16 hayden__wang 阅读(812) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' 知识点: 1. 随机数的批量生成 2. 列表元素值的判断,及计算 ''' from __future__ import division ''' 导入python未来支持的语言特征division(精确除法),当我们没有在程序中导入 该特征时,"/"操作符执行的是截断除法(Truncatin... 阅读全文
posted @ 2017-12-11 13:56 hayden__wang 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #!/bin/sh #ver 0.1 0706/2017 hayden #this script for disable Xenserver VM VNC Console port #yelang007sheng@163.com start_iptables(){ xen_ver=`cat /etc/redhat-release |awk '{print $3}' |awk -F\.... 阅读全文
posted @ 2017-12-08 17:56 hayden__wang 阅读(1046) 评论(0) 推荐(0) 编辑
摘要: #!/bin/sh #this script for get xenserver 6.5 7.0 VM VBD and Host storage read/write response time #2016/12/21 hayden #2016/12/29 #use tool rrd2csv #rrd2csv AVERAGE:host:12fa2131-192a-4f7d-a65d-8ff... 阅读全文
posted @ 2017-12-08 15:47 hayden__wang 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 如出现上图情况,xenserver需要打补丁,rrd2csv监控不全 阅读全文
posted @ 2017-12-08 15:44 hayden__wang 阅读(716) 评论(0) 推荐(0) 编辑
摘要: #! /bin/sh #this script for get xenserver 6.5 7.0 network useage #xen-host-network.sh v0.02 #send xen-host-network.sh to xenserver use ftp or ssh first ./xen-host-network.sh #date: 2016-08-12 ha... 阅读全文
posted @ 2017-12-08 15:17 hayden__wang 阅读(530) 评论(0) 推荐(0) 编辑