原创:vsphere概念深入系列三:vSphere命令行管理
2013-12-09 15:07
507 查看
假设无法近距离接触物理主机,只能远程命令行管理,。
以下命令行可以起到点作用。
首先需要安装vSphere CLI工具。
启动后界面:
Note: While there are some similarities between vifs and DOS or Unix file system management utilities, there are also many differences. For example, vifs does not support wildcard characters or current directories and, as a result, relative path names. Use vifs only as documented.
如果有多个数据中心,操作datastore的时候需要加上—dc(-Z)参数附加上数据中心的名字。
注意:此方法是用web方式的HTTP PUT,而且只能上传并覆盖host已经存在的文件,不能上传新文件。
报错的例子:
List the volumes available to the host. This includes VMFS, NAS and VFAT partitions.
--help | -h
Show the help message.
列出快照
以下命令行可以起到点作用。
首先需要安装vSphere CLI工具。
启动后界面:
1.查看datastore内容
所有命令行工具都可以加上—server,—username,—password等配置参数连接。--help可以显示帮助1.2 vifs命令行参数
vifs [<connection_options>] [--copy <source> <target> | --dir <remote_dir> | --help | --force | --get <remote_path> <local_path> | --listdc | --listds [--dc <datacenter>] | --mkdir <remote_dir> | --move <source> <target> | --put <local_path> <remote_path> | --rm <remote_path> | --rmdir <remote_dir> ]
DESCRIPTION
The vifs command performs common operations such as copy, remove, get, and put on files and directories. The command is supported against ESX/ESXi hosts but not against vCenter Server systems.Note: While there are some similarities between vifs and DOS or Unix file system management utilities, there are also many differences. For example, vifs does not support wildcard characters or current directories and, as a result, relative path names. Use vifs only as documented.
1.3示例用法:
Upload a file to the remote datastore:vifs <connection_options> -p "tmp/backup/VM.pl" "[StorageName] VM/VM.txt" -Z "ha-datacenter"
2.列出所有的datastore和数据中心
如果有多个数据中心,操作datastore的时候需要加上—dc(-Z)参数附加上数据中心的名字。
3.上传/删除文件到datastore
3.1删除文件示例
-Z参数此处可以忽略如果是单机,没有过个数据中心的话。3.2下载文件到本机
注意文件名要大小写区分。该脚本使用web方式HTTP GET得到文件。3.3从本机上传文件
注意:此方法是用web方式的HTTP PUT,而且只能上传并覆盖host已经存在的文件,不能上传新文件。
报错的例子:
4.查看文件系统volume
storage filesystem listList the volumes available to the host. This includes VMFS, NAS and VFAT partitions.
--help | -h
Show the help message.
列出快照
相关文章推荐
- 原创:vsphere概念深入系列二:vSphere交换机命令行查看排错
- 原创:vsphere概念深入系列一:关于vsphere虚拟交换机的端口的数量限制。
- 原创:vsphere概念深入系列五:存储
- C语言深入学习系列+-+字节对齐and内存管理
- [原创]windows server 2012 AD架构试验系列 – 14站点的其他概念
- 深入了解C#系列:谈谈C#中垃圾回收与内存管理机制
- vSphere 4系列之四:主机和虚拟机管理
- [Joe 原创] Web Control 开发系列(二) 深入解析Page的PostBack过程和IPostBackDataHandler
- 玩转Windows服务系列——命令行管理Windows服务
- [原创]ExtAspNet新春贺岁版 - 文件上传控件、复选框列表控件、完善布局管理、表格的行扩展列、完整的100多个中文示例、30多处BUG修正与功能增强、《ExtAspNet秘密花园》系列文章
- UML复习系列之一(基本概念)【原创】
- [原创-总结]深入理解C# 3.x的新特性系列总结
- [原创]ExtAspNet新春贺岁版 - 文件上传控件、复选框列表控件、完善布局管理、表格的行扩展列、完整的100多个中文示例、30多处BUG修正与功能增强、《ExtAspNet秘密花园》系列文章
- 深入理解管理“八心”系列-期望之心
- [vSphere学习系列]vSphere存储管理
- 数据库的缓存管理[ASPNET2.0深入挖掘系列听后感]
- (原创)深入研究java对String字符串对象的创建以及管理
- Samba 系列(二):在 Linux 命令行下管理 Samba4 AD 架构
- CISSP备考系列之安全管理的概念与原则[10-45]
- 【转】[原创]ExtAspNet新春贺岁版 - 文件上传控件、复选框列表控件、完善布局管理、表格的行扩展列、完整的100多个中文示例、30多处BUG修正与功能增强、《ExtAspNet秘密花园》系列文章