Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
removed user/pw from xcatws-test.sh
This commit is contained in:
commit
c58f440db1
@ -35,7 +35,7 @@ package xCAT::RemoteShellExp;
|
||||
node.
|
||||
DSH_TO_USERID - The userid on the node where the ssh keys will be updated.
|
||||
DSH_ENABLE_SSH - Node to node root passwordless ssh will be setup.
|
||||
|
||||
DSH_ZONE_SSHKEYS - directory containing the zones root .ssh keys
|
||||
|
||||
Usage: remoteshellexp
|
||||
[-t node list] test ssh connection to the node
|
||||
@ -144,7 +144,7 @@ sub remoteshellexp
|
||||
} else {
|
||||
$from_userid="root";
|
||||
}
|
||||
# set User on the node where we will send the keys
|
||||
# set User on the node where we will send the keys
|
||||
# this id can be a local id as well as root
|
||||
if ($ENV{'DSH_TO_USERID'}) {
|
||||
$to_userid=$ENV{'DSH_TO_USERID'};
|
||||
@ -154,18 +154,19 @@ sub remoteshellexp
|
||||
# set User home directory to find the ssh public key to send
|
||||
# For non-root ids information may not be in /etc/passwd
|
||||
# but elsewhere like LDAP
|
||||
|
||||
if ($ENV{'DSH_FROM_USERID_HOME'}) {
|
||||
$home=$ENV{'DSH_FROM_USERID_HOME'};
|
||||
$home=$ENV{'DSH_FROM_USERID_HOME'};
|
||||
} else {
|
||||
$home=xCAT::Utils->getHomeDir($from_userid);
|
||||
$home=xCAT::Utils->getHomeDir($from_userid);
|
||||
}
|
||||
|
||||
# This indicates we will generate new ssh keys for the user,
|
||||
# if they are not already there
|
||||
my $key="$home/.ssh/id_rsa";
|
||||
my $key2="$home/.ssh/id_rsa.pub";
|
||||
# Check to see if empty
|
||||
if (-z $key) {
|
||||
# unless using zones
|
||||
my $key="$home/.ssh/id_rsa";
|
||||
my $key2="$home/.ssh/id_rsa.pub";
|
||||
# Check to see if empty
|
||||
if (-z $key) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"The $key file is empty. Remove it and rerun the command.";
|
||||
@ -183,8 +184,7 @@ sub remoteshellexp
|
||||
}
|
||||
if (($flag eq "k") && (!(-e $key)))
|
||||
{
|
||||
# if the file size of the id_rsa key is 0, tell them to remove it
|
||||
# and run the command again
|
||||
# updating keys and the key file does not exist
|
||||
$rc=xCAT::RemoteShellExp->gensshkeys($expecttimeout);
|
||||
}
|
||||
# send ssh keys to the nodes/devices, to setup passwordless ssh
|
||||
@ -200,6 +200,9 @@ sub remoteshellexp
|
||||
if ($ssh_setup_cmd) { # setup ssh on devices
|
||||
$rc=xCAT::RemoteShellExp->senddeviceskeys($remoteshell,$remotecopy,$to_userid,$to_user_password,$home,$ssh_setup_cmd,$nodes, $expecttimeout);
|
||||
} else { #setup ssh on nodes
|
||||
if ($ENV{'DSH_ZONE_SSHKEYS'}) { # if using zones the override the location of the keys
|
||||
$home= $ENV{'DSH_ZONE_SSHKEYS'};
|
||||
}
|
||||
$rc=xCAT::RemoteShellExp->sendnodeskeys($remoteshell,$remotecopy,$to_userid,$to_user_password,$home,$nodes, $expecttimeout);
|
||||
}
|
||||
}
|
||||
@ -496,11 +499,14 @@ sub sendnodeskeys
|
||||
# copy to the node to the temp directory
|
||||
# scp $HOME/.ssh/tmp/authorized_keys to_userid@<node>:/tmp/$to_userid/.ssh
|
||||
# scp $HOME/.ssh/id_rsa.pub to_userid@<node>:/tmp/$to_userid/.ssh
|
||||
# Note if using zones, the keys do not come from ~/.ssh but from the
|
||||
# zone table, sshkeydir attribute. For zones the userid is always root
|
||||
# If you are going to enable ssh to ssh between nodes, then
|
||||
# scp $HOME/.ssh/id_rsa to that temp directory on the node
|
||||
# copy the script $HOME/.ssh/copy.sh to the node, it will do the
|
||||
# the work of setting up the user's ssh keys and clean up
|
||||
# ssh (run) copy.sh on the node
|
||||
|
||||
my @nodelist=split(/,/,$nodes);
|
||||
foreach my $node (@nodelist) {
|
||||
$sendkeys = new Expect;
|
||||
|
@ -427,23 +427,28 @@ rmdir \"/tmp/$to_userid\" \n";
|
||||
if (($from_userid eq "root") && (!($ENV{'DEVICETYPE'}))) {
|
||||
# Need to check if nodes are in a zone.
|
||||
my @zones;
|
||||
my $tab = xCAT::Table->new("zone");
|
||||
my $tab = xCAT::Table->new("zone");
|
||||
my @zones;
|
||||
if ($tab)
|
||||
{
|
||||
# if we have zones, need to send the zone keys to each node in the zone
|
||||
my @zones = $tab->getAllAttribs('zonename');
|
||||
my @attribs = ("zonename");
|
||||
@zones = $tab->getAllAttribs(@attribs);
|
||||
$tab->close();
|
||||
} else {
|
||||
$rsp->{data}->[0] = "Could not open zone table.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
return 1;
|
||||
}
|
||||
# check for zones, key send is different if zones defined or not
|
||||
|
||||
if (@zones) { # we have zones defined
|
||||
my $rc = xCAT::TableUtils->sendkeysTOzones($ref_nodes,$expecttimeout);
|
||||
if ($rc != 0)
|
||||
{
|
||||
$rsp->{data}->[0] = "Error sending ssh keys to the zones.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
exit 1;
|
||||
|
||||
}
|
||||
} else { # no zones
|
||||
@ -614,26 +619,117 @@ sub sendkeysNOzones
|
||||
#--------------------------------------------------------------------------------
|
||||
sub sendkeysTOzones
|
||||
{
|
||||
my ($class, $ref_nodes,$expecttimeout) = @_;
|
||||
my ($class, $ref_nodes,$expecttimeout) = @_;
|
||||
my @nodes=$ref_nodes;
|
||||
my $n_str = $nodes[0];
|
||||
my @nodelist= split(",", $n_str);
|
||||
my %zonehash =xCAT::Zone->getNodeZones(@nodelist);
|
||||
# for each zone in the zonehash
|
||||
# if sshbetweennodes is yes
|
||||
# $ENV{'DSH_ENABLE_SSH'} = "YES";
|
||||
# else
|
||||
# unset $ENV{'DSH_ENABLE_SSH'}
|
||||
# send the keys to the nodes
|
||||
# my $rc=xCAT::RemoteShellExp->remoteshellexp("s",$::CALLBACK,"/usr/bin/ssh",$nodelist,$expecttimeout);
|
||||
# if ($rc != 0)
|
||||
# {
|
||||
# $rsp->{data}->[0] = "remoteshellexp failed sending keys to $zonename.";
|
||||
# xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
#
|
||||
# }
|
||||
# } # endforeach
|
||||
return 0;
|
||||
my @nodes= split(",", $n_str);
|
||||
my $rsp = ();
|
||||
my $cmd;
|
||||
my $roothome = xCAT::Utils->getHomeDir("root");
|
||||
my $zonehash =xCAT::Zone->getzoneinfo($::CALLBACK,\@nodes);
|
||||
foreach my $zonename (keys %$zonehash) {
|
||||
# build list of nodes
|
||||
my $zonenodelist="";
|
||||
foreach my $node (@{$zonehash->{$zonename}->{nodes}}) {
|
||||
$zonenodelist .= $node;
|
||||
$zonenodelist .= ",";
|
||||
|
||||
}
|
||||
$zonenodelist =~ s/,$//; # remove last comma
|
||||
# if any nodes defined for the zone
|
||||
if ($zonenodelist) {
|
||||
# check to see if we enable passwordless ssh between the nodes
|
||||
if (!(defined($zonehash->{$zonename}->{sshbetweennodes}))||
|
||||
(($zonehash->{$zonename}->{sshbetweennodes} =~ /^yes$/i )
|
||||
|| ($zonehash->{$zonename}->{sshbetweennodes} eq "1"))) {
|
||||
|
||||
$ENV{'DSH_ENABLE_SSH'} = "YES";
|
||||
} else {
|
||||
delete $ENV{'DSH_ENABLE_SSH'}; # do not enable passwordless ssh
|
||||
}
|
||||
# point to the ssh keys to send for this zone
|
||||
my $keydir = $zonehash->{$zonename}->{sshkeydir} ;
|
||||
|
||||
# check to see if the id_rsa and id_rsa.pub key is in the directory
|
||||
my $key="$keydir/id_rsa";
|
||||
my $key2="$keydir/id_rsa.pub";
|
||||
# Check to see if empty
|
||||
if (!(-e $key)) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"The $key file does not exist for $zonename. Need to use chzone to regenerate the keys.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return 1;
|
||||
}
|
||||
if (!(-e $key2)) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"The $key2 file does not exist for $zonename. Need to use chzone to regenerate the keys.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
# now put copy.sh in the zone directory from ~/.ssh
|
||||
my $rootkeydir="$roothome/.ssh";
|
||||
if ($rootkeydir ne $keydir) { # the zone keydir is not the same as ~/.ssh.
|
||||
$cmd="cp $rootkeydir/copy.sh $keydir";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"Could not copy copy.sh to the zone key dir";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
# Also create $keydir/tmp and put root's id_rsa.pub (in authorized_keys) for the transfer
|
||||
$cmd="mkdir -p $keydir/tmp";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"Could not mkdir the zone $keydir/tmp";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
return 1;
|
||||
}
|
||||
# create authorized_keys file
|
||||
if (xCAT::Utils->isMN()) { # if on Management Node
|
||||
$cmd = " cp $roothome/.ssh/id_rsa.pub $keydir/tmp/authorized_keys";
|
||||
} else { # SN
|
||||
$cmd = " cp $roothome/.ssh/authorized_keys $keydir/tmp/authorized_keys";
|
||||
}
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
$rsp->{data}->[0] = "$cmd failed.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
chmod 0600, "$keydir/.ssh/tmp/authorized_keys";
|
||||
}
|
||||
# strip off .ssh
|
||||
my ($newkeydir,$ssh) = (split(/\.ssh/, $keydir));
|
||||
$ENV{'DSH_ZONE_SSHKEYS'} =$newkeydir ;
|
||||
# send the keys to the nodes
|
||||
my $rc=xCAT::RemoteShellExp->remoteshellexp("s",$::CALLBACK,"/usr/bin/ssh",
|
||||
$zonenodelist,$expecttimeout);
|
||||
if ($rc != 0)
|
||||
{
|
||||
$rsp = {};
|
||||
$rsp->{data}->[0] = "remoteshellexp failed sending keys to $zonename.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
|
||||
}
|
||||
} # end nodes in the zone
|
||||
|
||||
} # end for each zone
|
||||
|
||||
return (0);
|
||||
}
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -49,7 +49,7 @@ This program module file, is a set of Zone utilities used by xCAT *zone commands
|
||||
=cut
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
sub genSSHRootKeys
|
||||
sub genSSHRootKeys
|
||||
{
|
||||
my ($class, $callback, $keydir,$zonename,$rsakey) = @_;
|
||||
|
||||
@ -71,22 +71,6 @@ sub genSSHRootKeys
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# create /install/postscripts/_ssh/zonename if needed
|
||||
#
|
||||
my $installdir = xCAT::TableUtils->getInstallDir(); # get installdir
|
||||
if (!-d "$installdir/postscripts/_ssh/$zonename")
|
||||
{
|
||||
my $cmd = "/bin/mkdir -m 755 -p $installdir/postscripts/_ssh/$zonename";
|
||||
my $output = xCAT::Utils->runcmd("$cmd", 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = "Could not create $installdir/postscripts/_ssh/$zonename directory.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
#need to gen a new rsa key for root for the zone
|
||||
my $pubfile = "$keydir/id_rsa.pub";
|
||||
@ -152,29 +136,6 @@ sub genSSHRootKeys
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
return 1;
|
||||
}
|
||||
# copy authorized_keys for install on node
|
||||
if (-r $pubfile)
|
||||
{
|
||||
my $cmd =
|
||||
"/bin/cp -p $pubfile $installdir/postscripts/_ssh/$zonename ";
|
||||
my $output = xCAT::Utils->runcmd("$cmd", 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"Could not copy $pubfile to $installdir/postscripts/_ssh/$zonename";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
return 1;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"Could not copy $pubfile to $installdir/postscripts/_ssh/$zonename, because $pubfile does not exist.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
@ -188,7 +149,7 @@ sub genSSHRootKeys
|
||||
=cut
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
sub getdefaultzone
|
||||
sub getdefaultzone
|
||||
{
|
||||
my ($class, $callback) = @_;
|
||||
my $defaultzone;
|
||||
@ -262,7 +223,7 @@ sub iszonedefined
|
||||
=cut
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
sub getzoneinfo
|
||||
sub getzoneinfo
|
||||
{
|
||||
my ($class, $callback,$nodes) = @_;
|
||||
$::GETZONEINFO_RC=0;
|
||||
@ -279,6 +240,7 @@ sub getzoneinfo
|
||||
my $zonename=$zone->{zonename};
|
||||
$zonehash->{$zonename}->{sshkeydir}= $zone->{sshkeydir};
|
||||
$zonehash->{$zonename}->{defaultzone}= $zone->{defaultzone};
|
||||
$zonehash->{$zonename}->{sshbetweennodes}= $zone->{sshbetweennodes};
|
||||
# find the defaultzone
|
||||
if ((defined($zone->{defaultzone})) &&
|
||||
(($zone->{defaultzone} =~ /^yes$/i )
|
||||
@ -299,44 +261,40 @@ sub getzoneinfo
|
||||
my $nodelisttab = xCAT::Table->new("nodelist");
|
||||
my $nodehash = $nodelisttab->getNodesAttribs(\@$nodes, ['zonename']);
|
||||
# for each of the nodes, look up it's zone name and assign to the zonehash
|
||||
# if the node is a service node, it is assigned to the __xcatzone which gets its keys from
|
||||
# the ~/.ssh dir no matter what in the database for the zonename.
|
||||
# If the nodes nodelist.zonename attribute is a zonename, it is assigned to that zone
|
||||
# If the nodes nodelist.zonename attribute is undefined:
|
||||
# If there is a defaultzone in the zone table, the node is assigned to that zone
|
||||
# If there is no defaultzone in the zone table, the node is assigned to the ~.ssh keydir
|
||||
# If there is no defaultzone error out
|
||||
|
||||
|
||||
my @allSN=xCAT::ServiceNodeUtils->getAllSN("ALL"); # read all the servicenodes define
|
||||
my $xcatzone = "__xcatzone"; # if node is in no zones or a service node, use this one
|
||||
$zonehash->{$xcatzone}->{sshkeydir}= "~/.ssh";
|
||||
foreach my $node (@$nodes) {
|
||||
my $zonename;
|
||||
if (grep(/^$node$/, @allSN)) { # this is a servicenode, treat special
|
||||
$zonename=$xcatzone; # always use ~/.ssh directory
|
||||
} else { # use the nodelist.zonename attribute
|
||||
$zonename=$nodehash->{$node}->[0]->{zonename};
|
||||
}
|
||||
$zonename=$nodehash->{$node}->[0]->{zonename};
|
||||
if (defined($zonename)) { # zonename explicitly defined in nodelist.zonename
|
||||
# check to see if defined in the zone table
|
||||
if (!(grep(/^$zonename$/, @zones))) {
|
||||
# check to see if defined in the zone table
|
||||
unless ( xCAT::Zone->iszonedefined($zonename)) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"$node has a zonenane: $zonename that is not define in the zone table. Remove the zonename from the node, or create the zone using mkzone.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
$::GETZONEINFO_RC =1;
|
||||
return;
|
||||
}
|
||||
push @{$zonehash->{$zonename}->{nodes}},$node;
|
||||
}
|
||||
push @{$zonehash->{$zonename}->{nodes}},$node;
|
||||
} else { # no explict zonename
|
||||
if (defined ($defaultzone)) { # there is a default zone in the zone table, use it
|
||||
push @{$zonehash->{$defaultzone}->{nodes}},$node;
|
||||
} else { # if no default then use the ~/.ssh keys as the default, put them in the __xcatzone
|
||||
push @{$zonehash->{$xcatzone}->{nodes}},$node;
|
||||
} else { # if no default, this is an error
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"There is no default zone defined in the zone table. There must be exactly one default zone. ";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
$::GETZONEINFO_RC =1;
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
return $zonehash;
|
||||
}
|
||||
1;
|
||||
|
@ -24,7 +24,9 @@ B<chvm> I<noderange> [B<lparname>={B<*>|B<name>}]
|
||||
|
||||
B<chvm> I<noderange> [B<vmcpus=min/req/max>] [B<vmmemory=min/req/max>]
|
||||
[B<vmphyslots=drc_index1,drc_index2...>] [B<vmothersetting=hugepage:N,bsr:N>]
|
||||
|
||||
[B<vmnics=vlan1[,vlan2..]]> [B<vmstorage=<N|viosnode:slotid>>] [B<--vios>]
|
||||
[B<del_vadapter=slotid>]
|
||||
|
||||
=head2 VMware/KVM specific:
|
||||
|
||||
B<chvm> I<noderange> [B<-a> I<size>] [B<-d> I<disk>] [B<-p> I<disk>] [B<--resize> B<disk>=I<size>] [B<--cpus> I<count>] [B<--mem> I<memory>]
|
||||
@ -111,7 +113,7 @@ The administrator should use lsvm to get the profile content, and then edit the
|
||||
|
||||
For normal power machine:
|
||||
|
||||
chvm could be used to modify the resources assigned to partitions. The admin shall specify the attributes with options I<vmcpus>, I<vmmemory>, I<vmphyslots> and/or I<vmothersetting>. If nothing specified, nothing will be returned.
|
||||
chvm could be used to modify the resources assigned to partitions. The admin shall specify the attributes with options I<vmcpus>, I<vmmemory>, I<vmphyslots>, I<vmothersetting>, I<vmnics> and/or I<vmstorage>. If nothing specified, nothing will be returned.
|
||||
|
||||
=head2 VMware/KVM specific:
|
||||
|
||||
@ -199,6 +201,14 @@ Set LPAR name for the specified lpars. If '*' specified, it means to get names f
|
||||
|
||||
To specify the parameters that will be modified.
|
||||
|
||||
=item B<vmnics=value> B<vmstorage=value> [B<--vios>]
|
||||
|
||||
To create new virtual adapter for the specified node.
|
||||
|
||||
=item B<del_vadapter=value>
|
||||
|
||||
To specify the slot id of the virtual adapter will be deleted.
|
||||
|
||||
=back
|
||||
|
||||
=head2 VMware/KVM specific:
|
||||
|
@ -24,6 +24,7 @@ B<mkvm> I<noderange> [B<--full>]
|
||||
|
||||
B<mkvm> I<noderange> [B<vmcpus=min/req/max>] [B<vmmemory=min/req/max>]
|
||||
[B<vmphyslots=drc_index1,drc_index2...>] [B<vmothersetting=hugepage:N,bsr:N>]
|
||||
[B<vmnics=vlan1[,vlan2..]]> [B<vmstorage=<N|viosnode:slotid>>] [B<--vios>]
|
||||
|
||||
=head2 For KVM:
|
||||
|
||||
@ -55,7 +56,7 @@ Please note that the mkvm command currently only supports creating standard LPAR
|
||||
|
||||
With option I<full>, a partition using all the resources on a normal power machine will be created.
|
||||
|
||||
If no option is specified, a partition using the parameters specified with attributes such as 'vmcpus', 'vmmory', 'vmphyslots', 'vmothersetting' will be created. Those attributes can either be specified with '*def' commands running before or be specified with this command.
|
||||
If no option is specified, a partition using the parameters specified with attributes such as 'vmcpus', 'vmmory', 'vmphyslots', 'vmothersetting', 'vmnics', 'vmstorage' will be created. Those attributes can either be specified with '*def' commands running before or be specified with this command.
|
||||
|
||||
=head2 For KVM and Vmware:
|
||||
|
||||
@ -89,9 +90,11 @@ The cpu count which will be created for the kvm/vmware virtual machine.
|
||||
|
||||
Request to create a new full system partition for each CEC.
|
||||
|
||||
=item B<vmcpus=value> B<vmmemory=value> B<vmphyslots=value> B<vmothersetting=value>
|
||||
=item B<vmcpus=value> B<vmmemory=value> B<vmphyslots=value> B<vmothersetting=value> B<vmnics=value> B<vmstorage=value> [B<--vios>]
|
||||
|
||||
To specify the parameters which are used to create a partition. The I<vmcpus>, I<vmmemory> and I<vmphyslots> are necessay, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to L<lsvm(1)|lsvm.1> for more information about 'drc_index' for I<vmphyslots>.
|
||||
To specify the parameters which are used to create a partition. The I<vmcpus>, I<vmmemory> are necessay, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to L<lsvm(1)|lsvm.1> for more information about 'drc_index' for I<vmphyslots>.
|
||||
|
||||
The option I<vios> is used to specify the partition that will be created is a VIOS partition. If specified, the value for I<vmstorage> shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for I<vmphyslots>, all the physical slot of the power machine will be asigned to VIOS partition. If not specified, it shall be in form of I<vios_name:server_slotid> to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition.
|
||||
|
||||
=item B<-f|--force>
|
||||
|
||||
@ -318,6 +321,32 @@ The output is similar to:
|
||||
lpar1: 1/2/2
|
||||
lpar1: 128.
|
||||
|
||||
10. To create a vios partition using some of the resources on normal power machine.
|
||||
|
||||
mkvm viosnode vmcpus=1/4/16 vmmemory=1G/4G/32G vmphyslots=0x21010201,0x21010200 vmnics=vlan1 vmstorage=5 --vios
|
||||
|
||||
The resouces for the node is similar to:
|
||||
|
||||
viosnode: Lpar Processor Info:
|
||||
Curr Processor Min: 1.
|
||||
Curr Processor Req: 4.
|
||||
Curr Processor Max: 16.
|
||||
viosnode: Lpar Memory Info:
|
||||
Curr Memory Min: 1.00 GB(4 regions).
|
||||
Curr Memory Req: 4.00 GB(16 regions).
|
||||
Curr Memory Max: 32.00 GB(128 regions).
|
||||
viosnode: 1,513,U78AA.001.WZSGVU7-P1-T7,0x21010201,0xc03(USB Controller)
|
||||
viosnode: 1,512,U78AA.001.WZSGVU7-P1-T9,0x21010200,0x104(RAID Controller)
|
||||
viosnode: 1,0,U8205.E6B.0612BAR-V1-C,0x30000000,vSerial Server
|
||||
viosnode: 1,1,U8205.E6B.0612BAR-V1-C1,0x30000001,vSerial Server
|
||||
viosnode: 1,3,U8205.E6B.0612BAR-V1-C3,0x30000003,vEth (port_vlanid=1,mac_addr=4211509276a7)
|
||||
viosnode: 1,5,U8205.E6B.0612BAR-V1-C5,0x30000005,vSCSI Server
|
||||
viosnode: 1,6,U8205.E6B.0612BAR-V1-C6,0x30000006,vSCSI Server
|
||||
viosnode: 1,7,U8205.E6B.0612BAR-V1-C7,0x30000007,vSCSI Server
|
||||
viosnode: 1,8,U8205.E6B.0612BAR-V1-C8,0x30000008,vSCSI Server
|
||||
viosnode: 1,9,U8205.E6B.0612BAR-V1-C9,0x30000009,vSCSI Server
|
||||
viosnode: 0/0/0
|
||||
viosnode: 0.
|
||||
|
||||
=head1 FILES
|
||||
|
||||
|
@ -329,7 +329,7 @@ For statelite installations to sync files, you should use the
|
||||
read-only option for files/directories listed in
|
||||
litefile table with source location specified in the litetree table.
|
||||
|
||||
=item B<-g|--genmypost
|
||||
=item B<-g|--genmypost>
|
||||
|
||||
Will generate a new mypostscript file for the
|
||||
nodes in the noderange, if site precreatemypostscripts is 1 or YES.
|
||||
|
@ -66,7 +66,7 @@ sub process_request
|
||||
my $command = $request->{command}->[0];
|
||||
my $rc=0;
|
||||
# the directory which will contain the zone keys
|
||||
my $keydir="/etc/xcat/sshkeydir/";
|
||||
my $keydir="/etc/xcat/sshkeys/";
|
||||
|
||||
# check if Management Node, if not error
|
||||
unless (xCAT::Utils->isMN())
|
||||
@ -271,6 +271,7 @@ sub mkzone
|
||||
|
||||
# Create path to generated ssh keys
|
||||
$keydir .= $request->{zonename};
|
||||
$keydir .= "/.ssh";
|
||||
|
||||
|
||||
# update the zone table
|
||||
@ -394,7 +395,7 @@ sub usage
|
||||
|
||||
=head3
|
||||
|
||||
generate the ssh keys and store them in /etc/xcat/sshkeys/<zonename>
|
||||
generate the ssh keys and store them in /etc/xcat/sshkeys/<zonename>/.ssh
|
||||
|
||||
|
||||
=cut
|
||||
@ -459,7 +460,9 @@ sub updatezonetable
|
||||
my %xcatdefaultzone;
|
||||
$xcatdefaultzone{defaultzone} ="yes";
|
||||
$xcatdefaultzone{sshbetweennodes} ="yes";
|
||||
$xcatdefaultzone{sshkeydir} ="~/.ssh";
|
||||
my $roothome = xCAT::Utils->getHomeDir("root");
|
||||
$roothome .="\/.ssh";
|
||||
$xcatdefaultzone{sshkeydir} =$roothome;
|
||||
$tab->setAttribs({zonename => "xcatdefault"}, \%xcatdefaultzone);
|
||||
}
|
||||
|
||||
|
@ -78,18 +78,20 @@ if (!$::URL) {
|
||||
my @updatearray;
|
||||
my $fieldname;
|
||||
my $fieldvalue;
|
||||
my %entryhash;
|
||||
if (scalar(@ARGV) > 0){
|
||||
foreach my $tempstr (@ARGV){
|
||||
push @updatearray, $tempstr;
|
||||
push @updatearray, split(/=/,$tempstr);
|
||||
}
|
||||
}
|
||||
%entryhash=@updatearray;
|
||||
|
||||
my $request;
|
||||
|
||||
my $ua = LWP::UserAgent->new();
|
||||
my $response;
|
||||
if (($::METHOD eq 'PUT') || ($::METHOD eq 'POST')){
|
||||
my $tempstr = encode_json \@updatearray;
|
||||
my $tempstr = encode_json \%entryhash;
|
||||
$request = HTTP::Request->new($::METHOD => $::URL);
|
||||
$request->header('content-type' => 'text/plain');
|
||||
$request->header('content-length' => length($tempstr));
|
||||
|
@ -10,7 +10,9 @@ pw=$2
|
||||
format='format=json&pretty=1'
|
||||
|
||||
#todo: add a test case for every api call that is documented
|
||||
#todo: figure out why i currently have to specify -k
|
||||
#curl [options] [URL...]:
|
||||
# -X/--request <command> : commands include PUT,POST,GET and DELETE.
|
||||
# -k/--insecure : This option explicitly allows curl to perform "insecure" SSL connections and transfers.
|
||||
|
||||
curl -X GET -k "https://127.0.0.1/xcatws/nodes?userName=$user&password=$pw&$format"
|
||||
curl -X GET -k "https://127.0.0.1/xcatws/nodes?userName=$user&password=$pw&$format&field=mac"
|
||||
|
Loading…
x
Reference in New Issue
Block a user