博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS7 安装执行 VmwareCore
阅读量:7024 次
发布时间:2019-06-28

本文共 4090 字,大约阅读时间需要 13 分钟。

过去2年开始微软一直在沸沸扬扬地宣传PowerShell core,可以允许Windows的管理员在Linux/OSX 平台执行Powershell的管理命令。很多第三方的厂商也纷纷推出了自己的管理模块。不过对比起Windows下面的Powershell,Powershell core现在支持的模块实在太少,存在的bug也很多,所以之前豆子稍微试试发现不靠谱就没继续了。

前两天发现用新版本的PowerShell core 和 Vmware core模块了,下载试试看,发现之前的一些bug已经修复,安装也容易了很多,安装库里面都已经准备好了,不需要像之前的版本去编译。

登录CentOS 7, 直接执行yum就可以安装最新版本的Powershell core了

[root@sydnagios psl-omi-provider]# yum install powershellLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: centos.mirror.serversaustralia.com.au * epel: mirror.nsw.coloau.com.au * extras: centos.mirror.serversaustralia.com.au * updates: centos.mirror.serversaustralia.com.auPackage powershell-6.1.0~preview.1-1.rhel.7.x86_64 already installed and latest versionNothing to do

然后执行 pwsh就可以打开powershell core的控制台

[root@sydnagios psl-omi-provider]# pwshPowerShell v6.1.0-preview.1Copyright (c) Microsoft Corporation. All rights reserved.https://aka.ms/pscore6-docsType 'help' to get help.PS /tmp/psl-omi-provider> $PSVersionTableName                           Value----                           -----PSVersion                      6.1.0-preview.1PSEdition                      CoreGitCommitId                    v6.1.0-preview.1OS                             Linux 3.10.0-514.10.2.el7.x86_64 #1 SMP Fri Mar 3 00:04:05 UTC 2017Platform                       UnixPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}PSRemotingProtocolVersion      2.3SerializationVersion           1.1.0.1WSManStackVersion              3.0

然后在Powershell core的控制台下直接安装Vmware PowerCli core就行了

PS /tmp/psl-omi-provider> Install-Module -Name Vmware.PowerCli

安装完毕之后确认一下 就可以执行相关命令了

PS /tmp/psl-omi-provider> Connect-VIServer sydvcs2012WARNING: Please consider joining the VMware Customer Experience Improvement Program, so you can help us make PowerCLI a better product. You can join using the following command:Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $trueVMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to improve its products and services, to fix problems, and to advise you on how best to deploy and use our products.  As part of the CEIP, VMware collects technical information about your organization�s use of VMware products and services on a regular basis in association with your organization�s VMware license key(s).  This information does not personally identify any individual.For more details: type "help about_ceip" to see the related help article.

测试一下命令,输出某个主机当前的内存状态,成功

PS /tmp/psl-omi-provider> get-vmhost sydesx5.omnicom.com.au | get-stat -Realtime -MaxSamples 1 -memory                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    MetricId                Timestamp                          Value Unit     Instance                                                                                                                                                                                                                                           --------                ---------                          ----- ----     --------                                                                                                                                                                                                                                           mem.usage.average       9/04/18 1:57:40 pm                 52.15 %mem.active.average      9/04/18 1:57:40 pm               6190728 KBmem.vmmemctl.average    9/04/18 1:57:40 pm                     0 KBmem.granted.average     9/04/18 1:57:40 pm              75877672 KB

转载于:https://blog.51cto.com/beanxyz/2095960

你可能感兴趣的文章
ASP.NET MVC+EF框架+EasyUI实现权限管理系列(20)-多条件模糊查询和回收站还原的实现...
查看>>
管理管理器深度探索QT窗口系统---布局篇
查看>>
Jekyll – 基于纯文本的开源静态网站 & 博客系统
查看>>
HTML <font> 标签
查看>>
NSString / NSMutableString 字符串处理
查看>>
3、C语言中一般类型的指针变量细解
查看>>
zookeeper
查看>>
IEnumerable和IEnumerator 详解 (转)
查看>>
web service接口测试工具选型
查看>>
Stage3d 由浅到深理解AGAL的管线vertex shader和fragment shader || 简易教程 学习心得 AGAL 非常非常好的入门文章...
查看>>
vi编辑器的使用方式
查看>>
JOIN与EXISTS(子查询)的效率研究
查看>>
编码规范
查看>>
使用uliweb自动创建表单
查看>>
linux文本文件按列合并
查看>>
[javascript] ajaxfileupload.js 跨域上传文件
查看>>
android raw与assets区别
查看>>
C语言指针5分钟教程
查看>>
PHP GD库
查看>>
[整] Android Fragment 生命周期图
查看>>